有没有办法选择具有JavaScript最佳性能的实时流媒体源

时间:2017-09-18 08:18:04

标签: javascript html5 live-streaming

我正在制作一个html5网页,该网页会在桌面上嵌入RTMP直播,并使用ffmpeg将流媒体转换为Mpeg移动版。我正在使用video.jsjsmpeg来播放流媒体。

问题是:

我有很多流媒体资源,所以我在徘徊有没有办法选择具有最佳性能的来源?我可以使用JavaScript来测试流媒体源的质量吗?

实用代码示例:

// I got several source
let streamingSrc1 = "ws://192.168.124.227:8084";
let streamingSrc2 = "ws://192.168.133.228:8086";
let streamingSrc3 = "ws://192.168.155.229:8088";

////// Could I get the quality of streaming source before I decide to use it? 
let jsmpegSrc = streamingSrc1;
// or 
// let jsmpegSrc = streamingSrc2;
// or
// let jsmpegSrc = streamingSrc3;


// create jsmpeg player
let canvasId = "mpegPlayer";
let canvasDOM = document.getElementById(canvasId);
let player = new JSMpeg.Player(jsmpegSrc, {
    canvas: canvasDOM,
    videoBufferSize: 128 * 1024,
});

非常感谢你的帮助

0 个答案:

没有答案