dever 6 anni fa
parent
commit
cd962781d0
2 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 3 0
      doc/apidoc.php
  2. 10 0
      video/lib/Live.php

+ 3 - 0
doc/apidoc.php

@@ -469,6 +469,9 @@
  * @apiSuccess {String}   info.share_content 分享内容
  * @apiSuccess {String}   info.share_content 分享内容
  * @apiSuccess {String}   info.function 开启的功能,这是一个字符串,用逗号隔开的,1代表显示浏览量,2代表显示评论,3代表显示喜欢,4代表显示邀请阅读,如值为1,2,3,则显示浏览量、评论、喜欢,不显示邀请阅读
  * @apiSuccess {String}   info.function 开启的功能,这是一个字符串,用逗号隔开的,1代表显示浏览量,2代表显示评论,3代表显示喜欢,4代表显示邀请阅读,如值为1,2,3,则显示浏览量、评论、喜欢,不显示邀请阅读
  * @apiSuccess {String}   info.content 内容
  * @apiSuccess {String}   info.content 内容
+ * @apiSuccess {String}   info.stream 直播推流地址
+ * @apiSuccess {String}   info.url_mp4 回访播放地址
+ * @apiSuccess {String}   info.status 直播状态1为未开始2为直播中3为已结束
  *
  *
  *
  *
  * @apiSuccess {Object[]} comment 评论列表
  * @apiSuccess {Object[]} comment 评论列表

+ 10 - 0
video/lib/Live.php

@@ -18,10 +18,20 @@ class Live
     
     
         //embed
         //embed
         $time = time();
         $time = time();
+        $data['status'] = 1;
         $data['stream'] = '';
         $data['stream'] = '';
         if ($data['sdate'] <= $time && $time <= $data['edate']) {
         if ($data['sdate'] <= $time && $time <= $data['edate']) {
             $stream = Dever::db('live/stream')->one($data['stream_id']);
             $stream = Dever::db('live/stream')->one($data['stream_id']);
             $data['stream'] = $stream['live'];
             $data['stream'] = $stream['live'];
+            $data['status'] = 2;
+        }
+
+        if ($data['sdate'] > $time) {
+            $data['status'] = 1;
+        }
+
+        if ($data['edate'] <= $time) {
+            $data['status'] = 3;
         }
         }
         
         
         return $data;
         return $data;