dever 6 年之前
父节点
当前提交
7fab68ffc9
共有 1 个文件被更改,包括 11 次插入5 次删除
  1. 11 5
      live/lib/Qiniu.php

+ 11 - 5
live/lib/Qiniu.php

@@ -114,7 +114,8 @@ class Qiniu
     # 获取推流地址
     public function getRtmp($name, $time = 3600)
     {
-        $url = \Qiniu\Pili\RTMPPublishURL($this->config['domain_publish'], $this->config['space'], $name, $time, $this->config['appkey'], $this->config['appsecret']);
+        $stream = $this->get($name);
+        $url = $stream->RTMPPublishURL($this->config['domain_publish'], $this->config['space'], $name, $time, $this->config['appkey'], $this->config['appsecret']);
         return $url;
     }
 
@@ -132,28 +133,33 @@ class Qiniu
     # 获取直播地址
     public function getRtmpPlay($name)
     {
-        $url = \Qiniu\Pili\RTMPPlayURL($this->config['domain_live_rtmp'], $this->config['space'], $name);
+        $stream = $this->get($name);
+        //\Qiniu\Pili\RTMPPlayURL
+        $url = $stream->RTMPPlayURL($this->config['domain_live_rtmp'], $this->config['space'], $name);
         return $url;
     }
 
     # HLS 直播地址
     public function getHlsPlay($name)
     {
-        $url = \Qiniu\Pili\HLSPlayURL($this->config['domain_live_hls'], $this->config['space'], $name);
+        $stream = $this->get($name);
+        $url = $stream->HLSPlayURL($this->config['domain_live_hls'], $this->config['space'], $name);
         return $url;
     }
 
     # HDL 直播地址
     public function getHdlPlay($name)
     {
-        $url = \Qiniu\Pili\HDLPlayURL($this->config['domain_live_hdl'], $this->config['space'], $name);
+        $stream = $this->get($name);
+        $url = $stream->HDLPlayURL($this->config['domain_live_hdl'], $this->config['space'], $name);
         return $url;
     }
 
     # 截图直播地址
     public function getPicPlay($name)
     {
-        $url = \Qiniu\Pili\SnapshotPlayURL($this->config['domain_live_pic'], $this->config['space'], $name);
+        $stream = $this->get($name);
+        $url = $stream->SnapshotPlayURL($this->config['domain_live_pic'], $this->config['space'], $name);
         return $url;
     }
 }