zoukankan      html  css  js  c++  java
  • 直播-腾讯云推流-sdk 播放地址不正确一直没法播放的解决方案---蜻蜓系统-uniapp-flutter通用版

    直播-腾讯云推流-sdk 播放地址不正确一直没法播放的解决方案---蜻蜓系统-uniapp-flutter通用版

    /app/Services

    这个问题耽误了时间,有必要记录

    而方法在这部分:

    腾讯云后台

    简单说播放地址其实是固定的,之前方法有错,推流地址是需要加appname的,

    目前蜻蜓系统这个方法是这样写的播放地址

    原来的

     * 生成播放地址
         */
        public function getLiveUrl($streamName)
        {
            return [
                'rtmp_url'  => 'rtmp://' . $this->domain . '/' . $this->AppName . '/' . $streamName,
                'flv_url'   => 'http://' . $this->domain . '/' . $this->AppName . '/' . $streamName . '.flv',
                'hls_url'   => 'http://' . $this->domain . '/' . $this->AppName . '/' . $streamName . '.m3u8',
                'udp_url'   => 'webrtc://' . $this->domain . '/' . $this->AppName . '/' . $streamName
            ];
        }

    简单改成固定的就行:

       
        
         /**
         *新修改的 生成播放地址
         */
        
          public function getLiveUrl($streamName)
        {
            return [
                'rtmp_url'  => 'rtmp://' . $this->domain . '/' . 'live' . '/' . $streamName,
                'flv_url'   => 'http://' . $this->domain . '/' . 'live' . '/' . $streamName . '.flv',
                'hls_url'   => 'http://' . $this->domain . '/' . 'live' . '/' . $streamName . '.m3u8',
                'udp_url'   => 'webrtc://' . $this->domain . '/' . 'live' . '/' . $streamName
            ];
        }
        

    得到的地址一直是不对的,主要就是这个坑,播放和推流不一样。

  • 相关阅读:
    去掉移动端页面 input, textarea, button, a 标签获取焦点时显示的黑影
    屏蔽敏感词的正则表达式
    flex弹性布局详解
    解决微信小程序手机请求数据不返回的问题
    基于Express框架开发接口
    window平台下MongoDB安装和环境搭建
    搭建基于Express框架运行环境
    详解闭包(推荐)
    解决浏览器兼容ES6特性
    ES6之promise的使用
  • 原文地址:https://www.cnblogs.com/yangqiangche/p/14087652.html
Copyright © 2011-2022 走看看