zoukankan      html  css  js  c++  java
  • web 开发之js---js 调用视频播放

    var popWindow;
    var videoWindow;
    var videoWindowF;
    var currentVideo=null;
    var currentVideoTitle="";
    var currentItem="";
    var currentChapter=1;
    //window.onload=initPage;
    //初始化
    function initPage(){
    adjustIFrameSize()
    bindIframeEvt()
    }
    function bindIframeEvt(){
    // 为IFRAME绑定onload事件
    var cnt=document.getElementById("rightmain");
    if (cnt.addEventListener) {
    cnt.addEventListener("load", adjustIFrameSize, false);
    } else {
    cnt.attachEvent("onload", adjustIFrameSize);
    }
    }

    //iframe 控制
    function adjustIFrameSize() {
    var myIframe = document.getElementById("rightmain");
    if (myIframe) {
    if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
    // W3C DOM (and Mozilla) syntax
    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();


    }

  • 相关阅读:
    4_5.springboot2.x之Web开发RestfulCRUD操作
    4_4.springboot之Web开发登录和拦截器
    4_3.springboot2.x之默认访问首页和国际化
    4_2.springboot2.x配置之springmvc自动配置
    4_1.springboot2.xWeb开发使用thymeleaf
    03_springboot2.x日志处理
    08_springboot2.x自定义starter
    JavaScript-----对象属性赋值及获取属性值的方式
    Spring探究-----AOP配置详解
    Spring探究-----自动装配Bean详解
  • 原文地址:https://www.cnblogs.com/pengkunfan/p/4040415.html
Copyright © 2011-2022 走看看