I added an event handler to handle a mousedown event in firefox but I get a NS_error failure
message when this event is encountered, the error message is displayed on firefox but chrome handles the event properly.
Here is the section of code
document.getElementById("fancybox-close")
.addEventListener("mousedown", function () {
c.video.currentTime = "00:00";
document.getElementById("playr_video_curpos_" + c.video_id).innerHTML = c.parseTimeCode(c.video.currentTime);
}, false);
I attached the event listener to a close button on the video player, so when you click the close button the video is to be reset to 00:00
(Note: c = this
).
As said earlier this works on chrome but on firefox I get this error message
NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDOMHTMLVideoElement.currentTime]
Any idea why I get this message?
The currentTime
attribute takes a number, not a string. In this case, Chrome must do type coercion, while Firefox does not. For example:
c.video.currentTime = 0.0; // Seek to zero seconds
References
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.