mirror of
https://github.com/videojs/video.js.git
synced 2025-01-02 06:32:07 +02:00
Updated volume display to automically set itself.
This commit is contained in:
parent
d1fb95ecbf
commit
6945be3d6e
@ -45,7 +45,18 @@ $(function(){
|
||||
if (result === null) result = "<span class='undefined'>null</span>";
|
||||
if (result === undefined) result = "<span class='undefined'>undefined</span>";
|
||||
if (typeof result.start == "function") {
|
||||
result = (result.length > 0) ? "s:"+result.start(0)+" e:"+result.end(0) : "-";
|
||||
var newResult = "", i;
|
||||
if (result.length > 0) {
|
||||
|
||||
for (i=0;i<result.length;i++) {
|
||||
newResult += "l:"+result.length+" s:"+result.start(i)+" e:"+result.end(i);
|
||||
}
|
||||
} else {
|
||||
newResult = "-";
|
||||
}
|
||||
result = newResult;
|
||||
// result = result.toString();
|
||||
// result = (result.length > 0) ? "s:"+result.start(0)+" e:"+result.end(0) : "-";
|
||||
}
|
||||
} catch(e) {
|
||||
result = "<span class='na'>N/A</span>";
|
||||
|
@ -176,6 +176,11 @@ _V_.Component = _V_.Class.extend({
|
||||
for (var attrname in obj) {
|
||||
if (obj.hasOwnProperty(attrname)) { this[attrname]=obj[attrname]; }
|
||||
}
|
||||
},
|
||||
|
||||
// More easily attach 'this' to functions
|
||||
proxy: function(fn){
|
||||
return _V_.proxy(this, fn);
|
||||
}
|
||||
|
||||
});
|
9
src/controls.js
vendored
9
src/controls.js
vendored
@ -323,6 +323,11 @@ _V_.Slider = _V_.Component.extend({
|
||||
this.addEvent("mousedown", this.onMouseDown);
|
||||
this.addEvent("focus", this.onFocus);
|
||||
this.addEvent("blur", this.onBlur);
|
||||
|
||||
// Update Display
|
||||
// Need to wait for styles to be loaded.
|
||||
// TODO - replace setTimeout with stylesReady function.
|
||||
setTimeout(this.proxy(this.update), 0);
|
||||
},
|
||||
|
||||
createElement: function(type, attrs) {
|
||||
@ -399,8 +404,6 @@ _V_.Slider = _V_.Component.extend({
|
||||
boxW = box.offsetWidth,
|
||||
handle = this.handle;
|
||||
|
||||
// _V_.log(box.offsetLeft, box.offsetLeft)
|
||||
|
||||
if (handle) {
|
||||
var handleW = handle.el.offsetWidth;
|
||||
|
||||
@ -409,8 +412,6 @@ _V_.Slider = _V_.Component.extend({
|
||||
boxW = boxW - handleW;
|
||||
}
|
||||
|
||||
// _V_.log(event.pageX, boxX, boxW);
|
||||
|
||||
// Percent that the click is through the adjusted area
|
||||
return Math.max(0, Math.min(1, (event.pageX - boxX) / boxW));
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user