dever 6 лет назад
Родитель
Сommit
8fbd71697e
3 измененных файлов с 18 добавлено и 4 удалено
  1. 1 1
      live/database/stream_ios_log.php
  2. 2 2
      live/database/stream_log.php
  3. 15 1
      live/lib/Cron.php

+ 1 - 1
live/database/stream_ios_log.php

@@ -139,7 +139,7 @@ return array
             'desc'      => '直播回放地址',
             'match'     => 'option',
             //'update'    => 'text',
-            'list'      => true,
+            //'list'      => true,
         ),
 
         'state'     => array

+ 2 - 2
live/database/stream_log.php

@@ -128,7 +128,7 @@ return array
             'desc'      => '直播回放地址',
             'match'     => 'option',
             //'update'    => 'text',
-            'list'      => true,
+            //'list'      => true,
         ),
 
         'url_mp4'      => array
@@ -139,7 +139,7 @@ return array
             'desc'      => '直播回放地址',
             'match'     => 'option',
             //'update'    => 'text',
-            'list'      => true,
+            //'list'      => true,
         ),
 
         'state'     => array

+ 15 - 1
live/lib/Cron.php

@@ -39,7 +39,21 @@ class Cron
         if ($data) {
             $time = time();
             foreach ($data as $k => $v) {
-                if ($v[$video['stream_id']] > 0 && $v[$video['sdate']] > 0 && $v[$video['edate']] > 0 && $time >= $v[$video['edate']]) {
+                $state = false;
+                if ($v[$video['url_m3u8']]) {
+                    $url = explode('/', $v[$video['url_m3u8']]);
+                    $index = count($url)-1;
+                    $date = explode('-', $url[$index]);
+                    if ($date[0] != $v[$video['sdate']]) {
+                        $state = true;
+                    }
+                    if ($date[1] != $v[$video['edate']]) {
+                        $state = true;
+                    }
+                } else {
+                    $state = true;
+                }
+                if ($v[$video['stream_id']] > 0 && $state && $v[$video['sdate']] > 0 && $v[$video['edate']] > 0 && $time >= $v[$video['edate']]) {
                     $info = Dever::db('live/stream')->one($v[$video['stream_id']]);
                     $config = Dever::db('live/info')->one($info['live_id']);
                     $handle = new Handle();