Embed:
- updated videojs and dashjs - combo selection algorithm now tries to find maximum simultracks - when requesting stream info, add ?metaeverywhere=1 to the url to not count meta/subtitle tracks to simul_tracks and source priority sorting - updated videojs, dashjs and hlsjs players - improved html5 codec support testing - urlappend: improved behaviour when url already contains search params
This commit is contained in:
parent
6d86f98148
commit
eee3595d46
26 changed files with 452 additions and 185 deletions
|
@ -7,15 +7,60 @@ mistplayers.webrtc = {
|
|||
},
|
||||
isBrowserSupported: function (mimetype,source,MistVideo) {
|
||||
|
||||
if ((!("WebSocket" in window)) || (!("RTCPeerConnection" in window))) { return false; }
|
||||
if ((!("WebSocket" in window)) || (!("RTCPeerConnection" in window) || (!("RTCRtpReceiver" in window)))) { return false; }
|
||||
|
||||
//check for http/https mismatch
|
||||
if (location.protocol.replace(/^http/,"ws") != MistUtil.http.url.split(source.url.replace(/^http/,"ws")).protocol) {
|
||||
MistVideo.log("HTTP/HTTPS mismatch for this source");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//check if both audio and video have at least one playable track
|
||||
//gather track types and codec strings
|
||||
var playabletracks = {};
|
||||
var hassubtitles = false;
|
||||
for (var i in MistVideo.info.meta.tracks) {
|
||||
if (MistVideo.info.meta.tracks[i].type == "meta") {
|
||||
if (MistVideo.info.meta.tracks[i].codec == "subtitle") { hassubtitles = true; }
|
||||
continue;
|
||||
}
|
||||
if (!(MistVideo.info.meta.tracks[i].type in playabletracks)) {
|
||||
playabletracks[MistVideo.info.meta.tracks[i].type] = {};
|
||||
}
|
||||
playabletracks[MistVideo.info.meta.tracks[i].type][MistVideo.info.meta.tracks[i].codec] = 1;
|
||||
}
|
||||
|
||||
var tracktypes = [];
|
||||
for (var type in playabletracks) {
|
||||
var playable = false;
|
||||
|
||||
for (var codec in playabletracks[type]) {
|
||||
var supported = RTCRtpReceiver.getCapabilities(type).codecs;
|
||||
for (var i in supported) {
|
||||
if (supported[i].mimeType.toLowerCase() == (type+"/"+codec).toLowerCase()) {
|
||||
playable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (playable) {
|
||||
tracktypes.push(type);
|
||||
}
|
||||
}
|
||||
if (hassubtitles) {
|
||||
//there is a subtitle track, check if there is a webvtt source
|
||||
for (var i in MistVideo.info.source) {
|
||||
if (MistVideo.info.source[i].type == "html5/text/vtt") {
|
||||
tracktypes.push("subtitle");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return tracktypes.length ? tracktypes : false;
|
||||
|
||||
return true;
|
||||
//return true;
|
||||
},
|
||||
player: function(){}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue