#6048 currentTime error

This commit is contained in:
VisualSJ
2017-07-19 15:50:49 +08:00
parent 7479c5f4dd
commit 0789ac178a
+12 -1
View File
@@ -228,7 +228,18 @@ Audio.State = {
this._bindEnded(function () {
this._bindEnded();
}.bind(this));
this._element.currentTime = num;
try {
this._element.currentTime = num;
} catch (err) {
var _element = this._element;
if (_element.addEventListener) {
var func = function () {
_element.removeEventListener('loadedmetadata', func);
_element.currentTime = num;
};
_element.addEventListener('loadedmetadata', func);
}
}
};
proto.getCurrentTime = function () {
return this._element ? this._element.currentTime : 0;