video¶
-
class
webix.ui.
video
(data)¶ Arguments: - data (object) – A configuration object
Video view.
External references¶
Code¶
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | webix.protoUI({
name:"video",
$init:function(config){
if (!config.id) config.id = webix.uid();
this.$ready.push(this._init_video);
},
_init_video:function(){
var c = this._settings;
this._contentobj = webix.html.create("video",{
"class":"webix_view_video",
"style":"width:100%;height:100%;",
"autobuffer":"autobuffer"
},"");
if(c.poster)
this._contentobj.poster=c.poster;
if(c.src){
if(typeof c.src!= "object")
c.src = [c.src];
for(var i = 0; i < c.src.length;i++)
this._contentobj.innerHTML += ' <source src="'+ c.src[i]+'">';
}
if(c.controls)
this._contentobj.controls=true;
if(c.autoplay)
this._contentobj.autoplay=true;
this._viewobj.appendChild(this._contentobj);
},
getVideo:function(){
return this._contentobj;
},
defaults:{
src:"",
controls: true
}
}, webix.ui.view);
|