dever 6 年之前
父节点
当前提交
cd962781d0
共有 2 个文件被更改,包括 13 次插入0 次删除
  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.function 开启的功能,这是一个字符串,用逗号隔开的,1代表显示浏览量,2代表显示评论,3代表显示喜欢,4代表显示邀请阅读,如值为1,2,3,则显示浏览量、评论、喜欢,不显示邀请阅读
  * @apiSuccess {String}   info.content 内容
+ * @apiSuccess {String}   info.stream 直播推流地址
+ * @apiSuccess {String}   info.url_mp4 回访播放地址
+ * @apiSuccess {String}   info.status 直播状态1为未开始2为直播中3为已结束
  *
  *
  * @apiSuccess {Object[]} comment 评论列表

+ 10 - 0
video/lib/Live.php

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