帖子
帖子
用户
博客
课程
显示全部楼层
28
帖子
0
勋章
95
Y币
发表于 2020-6-5 17:09:15
5
未解决

txLive腾讯直播模块推流不成功 [复制链接]

  • 发表于:2020-06-05 17:09:15
  1. <!DOCTYPE html>
  2. <html>

  3. <head>
  4.     <meta charset="utf-8">
  5.     <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
  6.     <title>title</title>
  7.     <link rel="stylesheet" type="text/css" href="../css/api.css" />
  8.     <style>
  9.         body {
  10.             padding-top: 160px;
  11.             height: 1000px;
  12.         }

  13.         .content {
  14.             margin-top: 350px;
  15.         }

  16.         button {
  17.             margin: 10px;
  18.         }
  19.     </style>
  20. </head>

  21. <body>
  22.     <div class="content">
  23.         <button tapmode type="button" onclick="openPusher()" name="button">openPusher</button>
  24.         <button tapmode type="button" onclick="openPlayer()" name="button">openPlayer</button>
  25.         <button tapmode type="button" onclick="setLiveBtnsVisibility()" name="button">setLiveBtnsVisibility</button>
  26.     </div>
  27. </body>
  28. <script type="text/javascript" src="../script/api.js"></script>
  29. <script type="text/javascript">
  30.     apiready = function() {

  31.     };

  32.     function openPusher() {
  33.         var txLive = api.require('txLive');
  34.         txLive.openPusher({
  35.             x: 0,
  36.             y: 50,
  37.             h: 350,
  38.             w: api.winWidth,
  39.             fixedOn: api.frameName,
  40.             fixed: false,
  41.             url: "rtmp://============/live/yanshu1?txSecret=fd76896fb5f0277a56b3be2e62f6ab65&txTime=5EDB5BB8"   //填写腾讯云平台上生成的推流地址
  42.         });
  43.     }

  44. //播放接口,播放端使用
  45.     function openPlayer() {
  46.         var txLive = api.require('txLive');
  47.         txLive.openPlayer({
  48.             x: 0,
  49.             y: 0,
  50.             url: "rtmp://==============/live/yanshu1?txSecret=e9ecac5d6993bd7f4d92c3a62b5205ce&txTime=5EDB34CC"    //填写腾讯云平台上生成的播放地址
  51.         });
  52.     }

  53.     function setLiveBtnsVisibility() {
  54.         var txLive = api.require('txLive');
  55.         txLive.setLiveBtnsVisibility({
  56.             "btnid": "btnLog",
  57.             "show": 0
  58.         });
  59.     }
  60. </script>

  61. </html>
复制代码


28
帖子
0
勋章
95
Y币
OBS推流成功,txLive模块不行
28
帖子
0
勋章
95
Y币
licenceURL 和 licenceKey 一致
您需要登录后才可以回帖 登录

本版积分规则