agora.io - 如何修改示例应用程序以使 RTMP 注入视频在 UI 中排在首位?
问题描述
我正在使用示例RTMP 注入应用程序进行测试。我想修改应用程序,使注入的 RTMP 流应该是远程流网格中出现的第一个视频。有人可以帮忙吗?
解决方案
您可以使用 Vanilla JS在https://github.com/digitallysavvy/agora-web-broadcast-demo中使用来自agora-broadcast-client.js的类似代码设置网格的第一项:
// RTMP Connection (UI Component)
function addExternalTransmitionMiniView(rtmpUrl){
var container = $('#rtmp-controlers');
// append the remote stream template to #remote-streams
container.append(
$('<div/>', {'id': 'rtmp-container', 'class': 'container row justify-content-end mb-2'}).append(
$('<div/>', {'class': 'pulse-container'}).append(
$('<button/>', {'id': 'rtmp-toggle', 'class': 'btn btn-lg col-flex pulse-button pulse-anim mt-2'})
),
$('<input/>', {'id': 'rtmp-url', 'val': rtmpUrl, 'class': 'form-control col-flex" value="rtmps://live.facebook.com', 'type': 'text', 'disabled': true}),
$('<button/>', {'id': 'removeRtmpUrl', 'class': 'btn btn-lg col-flex close-btn'}).append(
$('<i/>', {'class': 'fas fa-xs fa-trash'})
)
)
);
}
因此,您可以设置要注入流的位置。
推荐阅读
- python - Django中多对多关系的通过模型中的复杂搜索
- android - 使用 Retrofit2 发出 Soap 请求时如何防止字符串被编码
- javascript - PHP对象数组到javascript关联数组
- java - Workaround for this calculator parsing error
- javascript - 如何在angular6组件中使用外部JS文件
- c# - Dynamics D365FO X++ 订阅 C#.NET 事件
- ios - 无法将类型“()”的值转换为预期的参数类型“__os_dispatch_queue_attr”
- python - python的正则表达式
- html - CSS slider doesn't scroll on mobile
- cloud-foundry - 如何在 PCF 中禁用“event_type”:“ContainerMetric”