]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Provide a link to the http stream when the browser is missing a vlc-compatible plugin. 7/head
authorJohn Törnblom <john.tornblom@gmail.com>
Wed, 5 Jan 2011 18:18:33 +0000 (19:18 +0100)
committerJohn Törnblom <john.tornblom@gmail.com>
Wed, 5 Jan 2011 18:36:47 +0000 (19:36 +0100)
src/webui/static/app/tvheadend.js

index ccb8feb653bc9e32d34e2772309971cee49d032c..a2047b09f7da80ba594df7b841cd0b2f071f1bf1 100644 (file)
@@ -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 = '<a href="' + url + '">' + chName + '</a>';
+         missingPlugin.innerHTML  = '<p>You are missing a plugin for your browser.</p>';
+         missingPlugin.innerHTML += '<p>You can still watch ' + chUrl + ' using an external player.</p>';
+         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() {