From: John Törnblom Date: Wed, 5 Jan 2011 18:18:33 +0000 (+0800) Subject: Provide a link to the http stream when the browser is missing a vlc-compatible plugin. X-Git-Tag: 2.99~118 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114ac7c3fd96a7d50ef358a5687391d96dc7b40a;p=thirdparty%2Ftvheadend.git Provide a link to the http stream when the browser is missing a vlc-compatible plugin. --- diff --git a/src/webui/static/app/tvheadend.js b/src/webui/static/app/tvheadend.js index ccb8feb65..a2047b09f 100644 --- a/src/webui/static/app/tvheadend.js +++ b/src/webui/static/app/tvheadend.js @@ -45,6 +45,10 @@ tvheadend.VLC = function(url) { vlc.style.display = 'none'; } + var missingPlugin = document.createElement('div'); + missingPlugin.style.display = 'none'; + missingPlugin.style.padding = '5px'; + var selectChannel = new Ext.form.ComboBox({ loadingText: 'Loading...', width: 200, @@ -59,8 +63,20 @@ tvheadend.VLC = function(url) { selectChannel.on('select', function(c, r) { var url = 'stream/channelid/' + r.data.chid; var chName = r.data.name; + if (!chName.length) { + chName = 'the channel'; + } + + if(!vlc.playlist || vlc.playlist == 'undefined') { + var chUrl = '' + chName + ''; + missingPlugin.innerHTML = '

You are missing a plugin for your browser.

'; + missingPlugin.innerHTML += '

You can still watch ' + chUrl + ' using an external player.

'; + missingPlugin.style.display = 'block'; + return; + } + vlc.style.display = 'block'; - + if(vlc.playlist && vlc.playlist.isPlaying) { vlc.playlist.stop(); } @@ -150,7 +166,7 @@ tvheadend.VLC = function(url) { disabled: true }, ], - items: [vlc] + items: [vlc, missingPlugin] }); win.on('render', function() {