博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
web 开发之js---js 调用视频播放
阅读量:6093 次
发布时间:2019-06-20

本文共 3460 字,大约阅读时间需要 11 分钟。

var popWindow;

var videoWindow;
var videoWindowF;
var currentVideo=null;
var currentVideoTitle="";
var currentItem="";
var currentChapter=1;
//window.οnlοad=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();
}

转载地址:http://sdmwa.baihongyu.com/

你可能感兴趣的文章
前端面试中的常见的算法问题
查看>>
计算机语言的基本理论
查看>>
nodejs流之行读取器例子
查看>>
批量文件重命名工具
查看>>
简单说一下UWP中的JumpList
查看>>
unity将object[]或者string对象转换成枚举enum
查看>>
以太坊系列之六: p2p模块--以太坊源码学习
查看>>
使用scikit-learn解决文本多分类问题(附python演练)
查看>>
2018 年最值得关注的 JavaScript 趋势
查看>>
什么是区块链?超级账本 Brian Behlendorf 从五个方面教你认识
查看>>
Linux中的帮助功能
查看>>
针对Android的Pegasus恶意软件版本和针对iOS的有什么不同?
查看>>
全局探色器
查看>>
Hive Export和Import介绍及操作示例
查看>>
http://mongoexplorer.com/ 一个不错的 mongodb 客户端工具。。。
查看>>
上传jar包到nexus私服
查看>>
Why Namespace? - 每天5分钟玩转 OpenStack(102)
查看>>
Project:如何分析项目中的资源分配情况
查看>>
HDU 4803 Poor Warehouse Keeper (贪心+避开精度)
查看>>
小错误汇总
查看>>