- HTTPS
This commit is contained in:
Cat 2016-11-16 14:44:14 +01:00 committed by Thulinma
parent 8ba26b11e9
commit 6e0aa9cf9b
2 changed files with 21 additions and 15 deletions

View file

@ -572,6 +572,14 @@ function mistPlay(streamName,options) {
//embedLog('Stream info contents: '+JSON.stringify(streaminfo)); //embedLog('Stream info contents: '+JSON.stringify(streaminfo));
streaminfo.initTime = new Date(); streaminfo.initTime = new Date();
//sort the sources by priority, but prefer HTTPS
streaminfo.source.sort(function(a,b){
function g(s) {
return s.priority + (s.url.indexOf('https://') > -1 ? 0.1 : 0)
}
return g(b) - g(a);
})
var mistPlayer = false; var mistPlayer = false;
var source; var source;
var forceType = false; var forceType = false;
@ -615,12 +623,10 @@ function mistPlay(streamName,options) {
return false; return false;
} }
function checkMime(p_shortname,mime) { function checkMime(p_shortname,mime) {
embedLog('Checking if Mist broadcasts '+mime+'..');
for (var s in streaminfo.source) { for (var s in streaminfo.source) {
if (streaminfo.source[s].type == mime) { if (streaminfo.source[s].type == mime) {
embedLog('Yup! Checking browser support..');
if (mistplayers[p_shortname].isBrowserSupported(mime)) { if (mistplayers[p_shortname].isBrowserSupported(mime)) {
embedLog('Yup! This is a working player/source combo.'); embedLog('Found a working combo: '+mistplayers[p_shortname].name+' with '+mime+' @ '+streaminfo.source[s].url);
streaminfo.working[p_shortname].push(mime); streaminfo.working[p_shortname].push(mime);
if (!source) { if (!source) {
mistPlayer = p_shortname; mistPlayer = p_shortname;
@ -632,6 +638,8 @@ function mistPlay(streamName,options) {
} }
} }
} }
embedLog('Mist doesn\'t broadcast '+mime+' or there is no browser support.');
return false; return false;
} }
@ -652,8 +660,6 @@ function mistPlay(streamName,options) {
} }
if (mistPlayer) { if (mistPlayer) {
embedLog('Preparing to build '+mistplayers[mistPlayer].name);
//create the options to send to the player //create the options to send to the player
var playerOpts = { var playerOpts = {
src: source.url+(('urlappend' in options) && (options.urlappend) ? options.urlappend : '' ), src: source.url+(('urlappend' in options) && (options.urlappend) ? options.urlappend : '' ),

View file

@ -15,7 +15,8 @@
<script> <script>
// global options can be set here // global options can be set here
var mistoptions = { var mistoptions = {
host: 'http://cattop:8080' //host: 'http://cat.mistserver.org:8080'
host: 'https://cat.mistserver.org:4433'
}; };
</script> </script>
@ -28,8 +29,6 @@
<script src=wrappers/silverlight.js></script> <script src=wrappers/silverlight.js></script>
<script src=wrappers/polytrope.js></script> <script src=wrappers/polytrope.js></script>
<script src=http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js>
<script src=players/dash.js></script> <script src=players/dash.js></script>
<link rel=stylesheet href=mist.css id=mist_player_css> <link rel=stylesheet href=mist.css id=mist_player_css>
@ -67,11 +66,15 @@
//tryplayers = Object.keys(mistplayers); //tryplayers = Object.keys(mistplayers);
tryplayers = []; tryplayers = [];
//tryplayers.push('html5'); tryplayers.push('html5');
//tryplayers.push('dashjs'); tryplayers.push('dashjs');
tryplayers.push('flash_strobe'); //tryplayers.push('flash_strobe');
//tryplayers.push('silverlight'); //tryplayers.push('silverlight');
streams = ['live']; streams = [];
//streams.push('live');
//streams.push('vids+mist.mp4');
//streams.push('lama');
streams.push('bunny');
for (var j in streams) { for (var j in streams) {
for (var i in tryplayers) { for (var i in tryplayers) {
@ -80,9 +83,6 @@
c.title = tryplayers[i]; c.title = tryplayers[i];
document.body.appendChild(c); document.body.appendChild(c);
mistPlay(streams[j],{ mistPlay(streams[j],{
//mistPlay('vids+mist.mp4',{
//mistPlay('lama',{
//mistPlay('bunny',{
target: c, target: c,
forcePlayer: tryplayers[i], forcePlayer: tryplayers[i],
loop: true loop: true