wesmiler пре 2 година
родитељ
комит
af7203423c
1 измењених фајлова са 8 додато и 6 уклоњено
  1. 8 6
      app/Services/LiveService.php

+ 8 - 6
app/Services/LiveService.php

@@ -55,8 +55,10 @@ class LiveService extends BaseService
         //未开启鉴权Key的情况下
         $pushDomain = ConfigService::make()->getConfigByCode('live_push_url');
         $playDomain = ConfigService::make()->getConfigByCode('live_play_url');
-        $accessKey = ConfigService::make()->getConfigByCode('live_url_access_key');
-        if($accessKey==''){
+        $pushKey = 'push_key2222';
+        $playKey = 'push_key666';
+//        $accessKey = ConfigService::make()->getConfigByCode('live_url_access_key');
+        if($pushKey==''){
             $pushUrl = 'rtmp://'.$pushDomain.'/'.$appName.'/'.$streamName;
 
             $playUrls['rtmp'] = 'rtmp://'.$playDomain.'/'.$appName.'/'.$streamName;
@@ -64,19 +66,19 @@ class LiveService extends BaseService
             $playUrls['hls'] = 'http://'.$playDomain.'/'.$appName.'/'.$streamName.'.m3u8';
         }else{
             $timeStamp = time() + $expireTime * 60;
-            $sstring = '/'.$appName.'/'.$streamName.'-'.$timeStamp.'-0-0-'.$accessKey;
+            $sstring = '/'.$appName.'/'.$streamName.'-'.$timeStamp.'-0-0-'.$pushKey;
             $md5hash = md5($sstring);
             $pushUrl = 'rtmp://'.$pushDomain.'/'.$appName.'/'.$streamName.'?auth_key='.$timeStamp.'-0-0-'.$md5hash;
 
-            $rtmpSstring = '/'.$appName.'/'.$streamName.'-'.$timeStamp.'-0-0-'.$accessKey;
+            $rtmpSstring = '/'.$appName.'/'.$streamName.'-'.$timeStamp.'-0-0-'.$playKey;
             $rtmpMd5hash = md5($rtmpSstring);
             $playUrls['rtmp'] = 'rtmp://'.$playDomain.'/'.$appName.'/'.$streamName.'?auth_key='.$timeStamp.'-0-0-'.$rtmpMd5hash;
 
-            $flvSstring = '/'.$appName.'/'.$streamName.'.flv-'.$timeStamp.'-0-0-'.$accessKey;
+            $flvSstring = '/'.$appName.'/'.$streamName.'.flv-'.$timeStamp.'-0-0-'.$playKey;
             $flvMd5hash = md5($flvSstring);
             $playUrls['flv'] = 'http://'.$playDomain.'/'.$appName.'/'.$streamName.'.flv?auth_key='.$timeStamp.'-0-0-'.$flvMd5hash;
 
-            $hlsSstring = '/'.$appName.'/'.$streamName.'.m3u8-'.$timeStamp.'-0-0-'.$accessKey;
+            $hlsSstring = '/'.$appName.'/'.$streamName.'.m3u8-'.$timeStamp.'-0-0-'.$playKey;
             $hlsMd5hash = md5($hlsSstring);
             $playUrls['hls'] = 'http://'.$playDomain.'/'.$appName.'/'.$streamName.'.m3u8?auth_key='.$timeStamp.'-0-0-'.$hlsMd5hash;
         }