txLive模块(直播类)试用分享
本文出自APICloud官方论坛,
感谢论坛版主uoaccw的分享。
txLive 模块封装了腾讯云直播服务
https://docs.apicloud.com/Client-API/Open-SDK/txLive
经过试用,这个模块堪称最简单最快速能使用起来的直播模块。
界面上的按钮,根据自己的需要,可以显示和隐藏。带有各种美颜功能(美白、瘦脸、V形脸)。推流的码率和清晰度可以设置。
使用流程:
1. 注册腾讯云平台
2. 进行实名认证
3. 开通直播服务
4. 生成推流地址(https://cloud.tencent.com/document/product/454/14551#URL)
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
<title>title</title>
<link rel="stylesheet" type="text/css" href="../css/api.css" />
<style>
body {
padding-top: 160px;
height: 1000px;
}
.content {
margin-top: 350px;
}
button {
margin: 10px;
}
</style>
</head>
<body>
<div class="content">
<button tapmode type="button" onclick="openPusher()" name="button">openPusher</button>
<button tapmode type="button" onclick="openPlayer()" name="button">openPlayer</button>
<button tapmode type="button" onclick="setLiveBtnsVisibility()" name="button">setLiveBtnsVisibility</button>
</div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">
apiready = function() {
};
function openPusher() {
var txLive = api.require('txLive');
txLive.openPusher({
x: 0,
y: 50,
h: 350,
w: api.winWidth,
fixedOn: api.frameName,
fixed: false,
url: "" //填写腾讯云平台上生成的推流地址
});
}
//播放接口,播放端使用
function openPlayer() {
var txLive = api.require('txLive');
txLive.openPlayer({
x: 0,
y: 0,
url: "" //填写腾讯云平台上生成的播放地址
});
}
function setLiveBtnsVisibility() {
var txLive = api.require('txLive');
txLive.setLiveBtnsVisibility({
"btnid": "btnLog",
"show": 0
});
}
</script>
</html>
复制代码
txLive模块(直播类)试用分享的更多相关文章
- APICloud开发者进阶之路 | txLive模块(直播类)试用分享
本文出自APICloud官方论坛,感谢论坛版主uoaccw的分享 txLive 模块封装了腾讯云直播服务 https://docs.apicloud.com/Client-API/Open-SDK/t ...
- 孤荷凌寒自学python第四十六天开始建构自己用起来更顺手一点的Python模块与类尝试第一天
孤荷凌寒自学python第四十六天开始建构自己用起来更顺手一点的Python模块与类,尝试第一天 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) 按上一天的规划,这是根据过去我自学其它编程语 ...
- VBA标准模块与类模块
大家通过之前的介绍,已知道怎么将一个空模块插入VBA的工程中.从插入模块中可以看到,模块有有两种——标准模块与类模块.类模块是含有类定义的特殊模块,包括其属性和方法的定义.在后面会有介绍与说明. 随着 ...
- php 文件上传类 实例分享
最近在研究php上传的内容,找到一个不错的php上传类,分享下. <?php /** * 文件上传类 * class: uploadFile * edit: www.jbxue.com */ c ...
- js模块,类,继承,命名空间,私有属性等相关概念梳理
js确切的说是一种基于对象的语言,和纯面向对象的语言(比如as)稍微有点区别,js中没有类的概念.虽然有继承但是基于原型的继承.随着前段越来越受重视,jser们利用js的一些特性他们制造出了和纯面向对 ...
- 直播类送礼动画<豪华礼物+小礼物>
直播类送礼动画<豪华礼物+小礼物>:代码会持续更新,现直播的app里内有太多的动画,由于时间关系不能一次共享所有动画聘为,这次先共享几个比较火爆的动画. 支持真机和模拟器上运行,最低支持i ...
- 模块工具类--utils
File: js\utils.js/** * 模块工具类,用来初始化各模块视图.自定绑定事件以及其他辅助功能等 * @class Utils */Utils = (function() { var i ...
- php ZIP压缩类实例分享
php ZIP压缩类实例分享 <?php $zipfiles =array("/root/pooy/test1.txt","/root/pooy/test2.txt ...
- Python第十一天 异常处理 glob模块和shlex模块 打开外部程序和subprocess模块 subprocess类 Pipe管道 operator模块 sorted函数 os模块 hashlib模块 platform模块 csv模块
Python第十一天 异常处理 glob模块和shlex模块 打开外部程序和subprocess模块 subprocess类 Pipe管道 operator模块 sorted函 ...
随机推荐
- java 九个预定义Class对象
基本的 Java 类型(boolean.byte.char.short.int.long.float 和 double)和关键字 void通过class属性也表示为 Class 对象: Class类中 ...
- Anagram——[枚举全排列]
预备知识: 1.求0—n个数全排列的算法: void print_permutation(int n,int *A,int cur){ if(cur==n){ ;i<cur;i++) cout& ...
- Java 5,6,7,8,9,10,11新特性吐血总结
作者:拔剑少年 简书地址:https://www.jianshu.com/u/dad4d9675892 博客地址:https://it18monkey.github.io 转载请注明出处 java5 ...
- H3C 因特网域名结构树
- tensorflow在文本处理中的使用——Word2Vec预测
代码来源于:tensorflow机器学习实战指南(曾益强 译,2017年9月)——第七章:自然语言处理 代码地址:https://github.com/nfmcclure/tensorflow-coo ...
- ORACLE禁用和启用外键
禁用外键 select 'alter table '|| t.table_name||' disable constraint '||t.constraint_name||';' from user_ ...
- ASP.NET WebForm Ajax请求Handler的经验
ajax代码 $.ajax({ type: "GET", url: "/AjaxHandler/GetPluginCode.ashx", data: " ...
- Servlet 的面试题
Servlet运行在Servlet容器中,其生命周期由容器来管理.Servlet的生命周期通过javax.servlet.Servlet接口中的init().service()和destroy()方法 ...
- Perl 的继承
Perl 类的定义 Perl的一个packag可以作为一个类使用,文件后缀名为.pm,并且把package里的函数当作类的方法来用.如: package Person; 创建和使用对象 大多数程序使用 ...
- PyTorch深度学习:60分钟入门(Translation)
这是https://zhuanlan.zhihu.com/p/25572330的学习笔记. Tensors Tensors和numpy中的ndarrays较为相似, 因此Tensor也能够使用GPU来 ...