},
_create: function() {
- var widget = this;
+ widget = this;
widget.element
.addClass( "ui-widget ui-widget-content ui-corner-all" );
.appendTo(widget.$controls);
$formats = $('.ui-nsvideo-formats', $formats[0]);
$.each(widget.options.src, function(index, value) {
- id = widget.element.attr('id') + '-format-' + index;
- definition = value.res.substring(value.res.indexOf('x')+1)+'p';
+ var id = widget.element.attr('id') + '-format-' + index;
+ var definition = value.res.substring(value.res.indexOf('x')+1)+'p';
$('<input type="radio" id="' + id + '" name="format" />')
.appendTo($formats)
.attr('checked', (index == widget.options.srcIndex))
},
video: function() {
- widget = this;
+ var widget = this;
// Select video source.
// If src option is string, that's the source.
widget.$videoContainer.html('');
// Install buttons or not supported message if required
- var $installContainer = $('<div class="container-install-in-widget"></div>')
- .appendTo(widget.$videoContainer);
- $installContainer
- .nsinstall({
- type: widget.options.type,
- hideIfAlreadyInstalled: true
- });
+ if (typeof $.fn.nsinstall == 'function')
+ {
+ widget.$installContainer = $('<div class="container-install-in-widget"></div>')
+ .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;
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();
},
seeking: function() {
widget.html5.refreshState();
- },
+ }
});
}
// VLC
},
_setWidgetWidth: function() {
+ //var widget = this;
+
if (widget.$video.width() < 640)
{
widget.element.css('width',
},
refreshState: function() {
+ //var widget = this;
+
var err = "";
var normal = "";
var network = "";
},
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();