mirror of
https://github.com/videojs/video.js.git
synced 2025-07-15 01:34:23 +02:00
Updated volume display to automically set itself.
This commit is contained in:
@ -45,7 +45,18 @@ $(function(){
|
|||||||
if (result === null) result = "<span class='undefined'>null</span>";
|
if (result === null) result = "<span class='undefined'>null</span>";
|
||||||
if (result === undefined) result = "<span class='undefined'>undefined</span>";
|
if (result === undefined) result = "<span class='undefined'>undefined</span>";
|
||||||
if (typeof result.start == "function") {
|
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) {
|
} catch(e) {
|
||||||
result = "<span class='na'>N/A</span>";
|
result = "<span class='na'>N/A</span>";
|
||||||
|
@ -176,6 +176,11 @@ _V_.Component = _V_.Class.extend({
|
|||||||
for (var attrname in obj) {
|
for (var attrname in obj) {
|
||||||
if (obj.hasOwnProperty(attrname)) { this[attrname]=obj[attrname]; }
|
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("mousedown", this.onMouseDown);
|
||||||
this.addEvent("focus", this.onFocus);
|
this.addEvent("focus", this.onFocus);
|
||||||
this.addEvent("blur", this.onBlur);
|
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) {
|
createElement: function(type, attrs) {
|
||||||
@ -399,8 +404,6 @@ _V_.Slider = _V_.Component.extend({
|
|||||||
boxW = box.offsetWidth,
|
boxW = box.offsetWidth,
|
||||||
handle = this.handle;
|
handle = this.handle;
|
||||||
|
|
||||||
// _V_.log(box.offsetLeft, box.offsetLeft)
|
|
||||||
|
|
||||||
if (handle) {
|
if (handle) {
|
||||||
var handleW = handle.el.offsetWidth;
|
var handleW = handle.el.offsetWidth;
|
||||||
|
|
||||||
@ -409,8 +412,6 @@ _V_.Slider = _V_.Component.extend({
|
|||||||
boxW = boxW - handleW;
|
boxW = boxW - handleW;
|
||||||
}
|
}
|
||||||
|
|
||||||
// _V_.log(event.pageX, boxX, boxW);
|
|
||||||
|
|
||||||
// Percent that the click is through the adjusted area
|
// Percent that the click is through the adjusted area
|
||||||
return Math.max(0, Math.min(1, (event.pageX - boxX) / boxW));
|
return Math.max(0, Math.min(1, (event.pageX - boxX) / boxW));
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user