Web Development JS---JS call video playback

Source: Internet
Author: User

var Popwindow;
var Videowindow;
var videowindowf;
var currentvideo=null;
var currentvideotitle= "";
var currentitem= "";
var currentchapter=1;
Window.onload=initpage;
Initialization
function Initpage () {
Adjustiframesize ()
BINDIFRAMEEVT ()
}
function Bindiframeevt () {
To bind an onload event to an IFRAME
var Cnt=document.getelementbyid ("Rightmain");
if (Cnt.addeventlistener) {
Cnt.addeventlistener ("Load", adjustiframesize, false);
} else {
Cnt.attachevent ("onload", adjustiframesize);
}
}

IFRAME Control
function Adjustiframesize () {
var myiframe = document.getElementById ("Rightmain");
if (myiframe) {
if (myiframe.contentdocument && myIframe.contentDocument.body.offsetHeight) {
Syntax DOM (and Mozilla)
if (myiframe.contentdocument.body.offsetheight>screen.availheight-404) {
Myiframe.height = myiframe.contentdocument.body.offsetheight+100;
}else{
Myiframe.height =screen.availheight-374
}

} else if (myiframe.document && myIframe.Document.body.scrollHeight) {
IE DOM Syntax
if (myiframe.document.body.scrollheight>screen.availheight-404) {
Myiframe.height = myiframe.document.body.scrollheight+100;
}else{
myiframe.height=screen.availheight-374
}
}
}
}

function Showtips (target) {
Target.blur ()
var theelement=target.nextsibling
if (theelement.style.display== "inline") {
Theelement.style.display= "None"
}else{
theelement.style.display= "inline"
}
Adjustiframesize ()

}
function Showhideanswer (target) {
Target.blur ()
var theelement=target.parentnode.parentnode.nextsibling
Alert (TheElement.style.display)
if (theelement.style.display== "block") {
Theelement.style.display= "None"
}else{
theelement.style.display= "Block"
}
Adjustiframesize ()

}
function Showhidenote (target) {
Target.blur ()
var theelement=target.parentnode.parentnode.nextsibling
Alert (TheElement.style.display)
if (theelement.style.display== "block") {
Theelement.style.display= "None"
}else{
theelement.style.display= "Block"
}
Adjustiframesize ()

}
////////////////////////////
function Launchvideo (VIDEOID,VIDEOTITLE,CC) {
if (VIDEOWINDOWF) {
Videowindowf.close ();
}
currentvideo=videoid;
Currentvideotitle=videotitle;
CURRENTCHAPTER=CC;
var videodirectory= ""
if (currentitem== "Videolist") {
Videodirectory= ". /.. /media/";
}else{
Videodirectory= ". /.. /media/";
}
Alert (WINDOW.LOCATION.HREF)
videowindow= window.open (videodirectory+ "videoplayer.html", "Videos", "Width=470,height=510,resizable=no, Scrollbars=no ");
Videowindow.moveto (0,0);
Videowindow.focus ();
}
function Launchvideo_f (videoid,videotitle) {
if (Videowindow) {
Videowindow.close ();
}
if (videoid) {
currentvideo=videoid;
}
if (videotitle) {
Currentvideotitle=videotitle;
}
var videodirectory= "";
var thew=780;
if (screen.availwidth) {
thew=screen.availwidth-10;
}
var theh=560;
if (screen.availheight) {
theh=screen.availheight-40;
}
videowindowf= window.open (videodirectory+ "videoplayer_f.html", "Videos_f", "width=" +thew+ ", height=" +theH+ ", Resizable=yes,scrollbars=no ");
Videowindowf.moveto (0,0);
Videowindowf.focus ();
}
////////////////////////////////
function Launchquiz (Quizid) {
var quizurl=quizid+ ". html"
popwindow= window.open (Quizurl, "Popwin", "Width=579,height=600,resizable=no,scrollbars=yes");
Popwindow.focus ();
}
function Launchreadings (readingid) {

var readingurl= "readings/" +readingid+ ". html";
popwindow= window.open (Readingurl, "Popwin", "Width=579,height=600,resizable=no,scrollbars=yes");
Popwindow.focus ();

}
function Launchreference (Referenceid) {

var referenceurl= ".. /references/"+referenceid+". html ";
popwindow= window.open (Referenceurl, "Popwin", "Width=579,height=550,resizable=no,scrollbars=yes");
Popwindow.focus ();


}

Web Development JS---JS call video playback

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.