'm trying to limit the number of times someone can play a video.
This is for quiz purposes. A student should recognize an American Sign Language sign with two or fewer playbacks.
Using straight HTML5 with JavaScript it looks like:
function playVideo() {
var nbrPlay = clickdata[(qNbr-1)]
if (nbrPlay<2){
clickdata[i-1]=nbrPlay+1;
clickdata[(qNbr-1)] = nbrPlay+1;
v.load();
document.getElementById("videoPlayer").style.visibility = "visible";
}
else{
//alert("You may only view the video 2 times.")
limitViews();//sends an alert so the user knows he has exceeded the limit.
}
I can't figure out how to do something similar with the MediaElement.js player.
I would be happy to either:
- Use the built in controller, but limit the number of times user can click "play"
- Remove the controller (Yes, I know how) and use my own button.
Any suggestions?
Here's the application for anyone interested in seeing what I am trying to accomplish: