I am trying to use video.js to prevent fast-forward, but to allow fast-forward, for mp4 video on the Moodle site. The following script works in Chrome and Opera, but not in Microsoft Edge:
window.onload = function() {
if ($('iframe').length > 0) {
$('iframe').ready(function() {
var videoPlayer = $('iframe').contents().find('video')[0];
var cssLink = document.createElement("link")
cssLink.href = "https://vjs.zencdn.net/5.0/video-js.min.css";
cssLink.rel = "stylesheet";
cssLink.type = "text/css";
$('iframe').contents().find('head').append(cssLink);
videojs(videoPlayer, {}, function() {
var vjsPlayer = this;
$('iframe').contents().find('video').prop('controls', 'true');
$('iframe').contents().find('div .vjs-big-play-button').html('');
$('iframe').contents().find('div .vjs-control-bar').html('');
$('iframe').contents().find('div .vjs-caption-settings').html('');
var currentTime = 0;
vjsPlayer.on("seeking", function(event) {
if (currentTime < vjsPlayer.currentTime()) {
vjsPlayer.currentTime(currentTime);
}
});
vjsPlayer.on("seeked", function(event) {
if (currentTime < vjsPlayer.currentTime()) {
vjsPlayer.currentTime(currentTime);
}
});
setInterval(function() {
if (!vjsPlayer.paused()) {
currentTime = vjsPlayer.currentTime();
}
}, 1000);
});
});
}
}
In Edge, the desired effect is achieved (forward search does not change the time on the video, but reverse search does), however, the playback / pause functions are violated. If I searched an odd number of times in any direction, the video pauses and only plays when I hold the play button. If I searched an even number of times (including zero), the video plays, but the pause button does nothing. I get the same results in Firefox, and also posted a question about this .
type="video/mp4" , .
, AddType video/mp4 .mp4 .htaccess, Moodle. .htaccess:
deny from all
AllowOverride None
Note: this file is broken intentionally, we do not want anybody to undo it in subdirectory!
?
- mp4 Microsoft Edge?