X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=blobdiff_plain;f=js%2Fjquery.ui.nsvideo.js;h=e556fda937e233750913e1ab0040e37ba7343d41;hb=3177ec9aa46ca4feeb9eda48d9b6bce66a722f42;hp=ccb461d28f91016ab2403652d5ea170b2e31a8b0;hpb=9e326b335014eac0c6c6476402654b19c57a396f;p=living-lab-site.git diff --git a/js/jquery.ui.nsvideo.js b/js/jquery.ui.nsvideo.js index ccb461d..e556fda 100644 --- a/js/jquery.ui.nsvideo.js +++ b/js/jquery.ui.nsvideo.js @@ -199,6 +199,21 @@ $.widget( "ui.nsvideo", { widget.$videoContainer.html(''); + // Install buttons or not supported message if required + if (typeof $.fn.nsinstall == 'function') + { + widget.$installContainer = $('
') + .appendTo(widget.$videoContainer); + widget.$installContainer + .nsinstall({ + type: widget.options.type, + hideIfAlreadyInstalled: true + }); + if (widget.$installContainer.nsinstall('option', 'error') + == 'already installed') + widget.$installContainer.hide(); + } + var width = widget.options.width; var height = widget.options.height; @@ -234,6 +249,10 @@ $.widget( "ui.nsvideo", { widget.html5.refreshVolume(); widget.html5.refreshState(); widget._setWidgetWidth(); + + if (widget.$video[0].error != 3 + && widget.$video[0].error != 4) + widget.$installContainer.hide(); }, seeked: function() { widget.html5.play(); @@ -817,6 +836,11 @@ $.widget( "ui.nsvideo", { }, play: function() { + if(typeof widget.$video[0].playlist.isPlaying == 'undefined') + return widget; + + widget.$installContainer.hide(); + if (! widget.$video[0].playlist.isPlaying) widget.$video[0].playlist.play(); @@ -833,6 +857,9 @@ $.widget( "ui.nsvideo", { }, pause: function() { + if (typeof widget.$video[0].playlist === 'undefined') + return widget; + if (widget.$video[0].playlist.isPlaying) widget.$video[0].playlist.togglePause();