官方文档:https://docs.apicloud.com/Client-API/Open-SDK/txLive
实例项目:https://github.com/Xingtao/FFdynamic
参考后台管理项目:http://oubo1.ozhong.com/admin
方维互动直播系统全套源码+app源码(含android+ios)+全套配置文档
:http://www.pansoso.com/a/1341251/
官方sdk接口:https://docs.apicloud.com/Client-API/Open-SDK/txLive
https://download.youkuaiyun.com/download/yllaji/10719552
参数 | 类型 | 描述 | 默认值 |
x | 数字 | (可选项) | 0 |
y | 数字 | (可选项) | 0 |
w | 数字 | (可选项) | 屏幕宽度 |
h | 数字 | (可选项) | 屏幕高度 |
url | 字符串 | 必填项,推流的rtmp地址 |
|
fixedOn | 字符串 | (可选项)模块视图添加到指定 frame 的名字(只指 frame,传 window 无效) | 模块依附于当前 window
|
fixed | 布尔 | (可选项)是否将模块视图固定到窗口上(不跟随窗口上下滚动) | true
|
示例代码
var txLive = api.require('txLive');
txLive.openPusher({
url : "rtmp://xxxxx.livepush.myqcloud.com/xxxxxxx"
});
setLiveBtnsVisibility
控制推流界面按钮可见状态
setLiveBtnsVisibility({params})
参数 | 类型 | 描述 | 取值范围: |
btnid | 字符串 | 界面的可见按钮ID, |
|
show | 数字 | 按钮可见状态0为隐藏1为显示 |
|
示例代码
var txLive = api.require('txLive');
txLive.setLiveBtnsVisibility({
"btnid" : "btnLog",
"show" : 1
});
通过按钮id来模拟点击按钮
liveBtnsPerformClickById({params})
参数 | 类型 | 描述 | 取值范围: |
btnid | 字符串 | 界面的可见按钮ID, |
|
示例代码
var txLive = api.require('txLive');
txLive.liveBtnsPerformClickById({
"btnid" : "btnLog"
});
startPush
开始推流
startPush();
示例代码
var txLive = api.require('txLive');
txLive.startPush();
stopPush
结束视频推流
stopPush();
示例代码
var txLive = api.require('txLive');
txLive.stopPush();
openPlayer
播放视频
openPlayer({params})
参数 | 类型 | 描述 | 默认值 |
x | 数字 | (可选项) | 0 |
y | 数字 | (可选项) | 0 |
w | 数字 | (可选项) | 屏幕宽度 |
h | 数字 | (可选项) | 屏幕高度 |
url | 字符串 | 必填项,播放视频地址 |
|
type | 数字 | 1 | 0 => PLAY_TYPE_LIVE_FLV 1 => PLAY_TYPE_LIVE_RTMP 2 => PLAY_TYPE_LIVE_RTMP_ACC 3 => PLAY_TYPE_LOCAL_VIDEO 4 => PLAY_TYPE_VOD_FLV 5 => PLAY_TYPE_VOD_HLS 6 => PLAY_TYPE_VOD_MP4 |
fixedOn | 字符串 | (可选项)模块视图添加到指定 frame 的名字(只指 frame,传 window 无效) | 模块依附于当前 window
|
fixed | 布尔 | (可选项)是否将模块视图固定到窗口上(不跟随窗口上下滚动) | true
|
示例代码
var txLive = api.require('txLive');
txLive.openPlayer({x : 0, y : 0,url : "视频播放地址"});
setPlayBtnsVisibility
设置播放界面按钮
setPlayBtnsVisibility();
参数 | 类型 | 描述 | 取值范围: |
btnid | 字符串 | 界面的可见按钮ID, |
|
show | 数字 | 按钮可见状态0为隐藏1为显示 |
|
示例代码
var txLive = api.require('txLive');
txLive.setPlayBtnsVisibility({"btnid" : "btnLog","show" : 1});
开始播放视频
startPlay()
示例代码
var txLive = api.require('txLive');
txLive.startPlay();
stopPlay
停止播放视频
stopPlay()
示例代码
var txLive = api.require('txLive');
txLive.stopPlay();
playBtnsPerformClickById
通过按钮id来模拟点击按钮
playBtnsPerformClickById({params})
参数 | 类型 | 描述 | 取值范围: |
btnid | 字符串 | 界面的可见按钮ID, |
|
示例代码
var txLive = api.require('txLive');
txLive.playBtnsPerformClickById({
"btnid" : "btnLog"
});
hidePlayer
隐藏视频
hidePlayer()
示例代码
var txLive = api.require('txLive');
txLive.hidePlayer();
showPlayer
显示视频
showPlayer()
示例代码
var txLive = api.require('txLive');
txLive.showPlayer();