// Get the Video Object
var v=document.getElementById("myvideo");
// Show the Adv Box i.e. the DIV
function show_adv() {
document.getElementById("my_ad").style.visibility="visible";
}
// Hide the Adv Box i.e. the DIV
function hide_adv() {
document.getElementById("my_ad").style.visibility="hidden";
}
// Execute this for each second when playing the Video
function catch_the_frame() {
var t;
t = Math.round(v.currentTime); // currentTime is float; Make it whole number to check
document.getElementById("seek_status").innerHTML="Current Time: " + t + " seconds"; // Show the current playing time in seconds
if ( t >= 8 && t <= 18) { // Target Second when we want to show the message/ad
show_adv(); // Show the message/ad
}else {
hide_adv(); // Show the message/ad
}
}
// Hide the video when page loaded
hide_adv();
// Handle the playing event
v.addEventListener('playing', function() {setInterval(catch_the_frame,500);}, false);
ndex: 99;
}
#my_ad {
position:absolute;
width:350px;
height:150px;
top: 10;
left: 10;
font-family: Arial;
font-size: 120%;
background-color:rgba(255,0,0,0.2);
z-index:100;
color: #ff0000;
}
#close a {
position:absolute;
top: 5;
left: 520;
z-index:100;
font-family: Arial;
font-size: 40%;
text-decoration: none;
}
.generic_txt{
font-family: Droid Sans,sans-serif;
font-size: 150%;
color: #0000ff;
}
.generic_txt_heading a {
font-family: Droid Sans,sans-serif;
font-size: 110%;
color: #00ff00;
text-decoration:none;
}
.generic_txt_heading2 {
font-family: Droid Sans,sans-serif;
font-size: 100%;
color: #0000ff;
text-decoration:none;
}
How are you? I hope you are having a nice day. Cheers!
0 التعليقات :
إرسال تعليق