equal
deleted
inserted
replaced
4 |
4 |
5 IriSP.Widgets.HtmlPlayer.prototype = new IriSP.Widgets.Widget(); |
5 IriSP.Widgets.HtmlPlayer.prototype = new IriSP.Widgets.Widget(); |
6 |
6 |
7 |
7 |
8 IriSP.Widgets.HtmlPlayer.prototype.defaults = { |
8 IriSP.Widgets.HtmlPlayer.prototype.defaults = { |
9 aspect_ratio: 14/9 |
|
10 } |
9 } |
11 |
10 |
12 IriSP.Widgets.HtmlPlayer.prototype.draw = function() { |
11 IriSP.Widgets.HtmlPlayer.prototype.draw = function() { |
13 |
12 |
14 |
13 |
17 } |
16 } |
18 |
17 |
19 if (this.url_transform) { |
18 if (this.url_transform) { |
20 this.video = this.url_transform(this.video); |
19 this.video = this.url_transform(this.video); |
21 } |
20 } |
22 |
|
23 if (!this.height) { |
|
24 this.height = Math.floor(this.width/this.aspect_ratio); |
|
25 this.$.css({ |
|
26 height: this.height |
|
27 }); |
|
28 } |
|
29 |
21 |
30 var videoEl = IriSP.jQuery('<video>'); |
22 var videoEl = IriSP.jQuery('<video>'); |
31 videoEl.attr({ |
23 videoEl.attr({ |
32 id : _tmpId, |
|
33 width : this.width, |
24 width : this.width, |
34 height : this.height |
25 height : this.height || undefined |
35 }); |
26 }); |
36 if(typeof this.video === "string"){ |
27 if(typeof this.video === "string"){ |
37 videoEl.attr("src",this.video); |
28 videoEl.attr("src",this.video); |
38 } else { |
29 } else { |
39 for (var i = 0; i < this.video.length; i++) { |
30 for (var i = 0; i < this.video.length; i++) { |