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();
}
web 开发之js---js 调用视频播放的更多相关文章
- 移动web开发之rem适配布局
移动web开发之rem适配布局 方案: 页面布局文字能否随着屏幕大小变化而变化 流式布局和flex布局主要针对于宽度布局,那高度如何布局? 怎样让屏幕发生变化的时候元素高度和宽度等比例缩放? 1. r ...
- Vim下的Web开发之html,CSS,javascript插件
Vim下的Web开发之html,CSS,javascript插件 HTML 下载HTML.zip 解压HTML.zip,然后将里面的所有文件copy到C:\Program Files\Vim\vi ...
- Web开发之Tomcat&Servlet
<!doctype html>01 - JavaEE - Tomcat&Servlet figure:first-child { margin-top: -20px; } #wri ...
- 原生+H5开发之:js交互【location方式】
1. 交互方式总结 1Android与JS通过WebView互相调用方法,实际上是: Android去调用JS的代码 JS去调用Android的代码 二者沟通的桥梁是WebView 对于Android ...
- 模块化开发之sea.js
随着时间的推移,原生js越来越强大,es6中的improt,export已经可以实现模块化开发,但可惜的是现在的浏览器还不支持,需要进行编译,相信在不久的将来,一定会大行其道,今天我们来聊聊模块化开发 ...
- HTML5+JS手机web开发之jQuery Mobile初涉
一.起始之语 我一直都是在PC上折腾网页的,这会儿怎么风向周边捣鼓起手机网页开发呢?原因是公司原先使用Java开发的产品,耗了不少人力财力,但是最后的效果却不怎么好.因为,Android系统一套东西, ...
- 模块化开发之sea.js实现原理总结
seajs官网说:seajs是一个模块加载器,所以学习它并不难. 在我的理解就是:本来我们是需要手动创建 script标签 引入 js文件的,但用seajs后,它就自动帮我们完成这些工作. 这里只说实 ...
- web 开发之js---ajax 异步处理
本文介绍了如何创建能够适应不同浏览器的XMLHttpRequest实例,建立和发送请求,并响应服务器.您将开始接触最基本和基础性的有关Ajax的全部对象和编程方法:XMLHttpRequest对象.该 ...
- web 开发之js---js 多线程编程
AJAX 开发中的难题 试试多线程编程 想了解更多 有关作者 转载注明出处:http://www.infoq.com/cn/articles/js_multithread 虽然有越来越多的网站在应 ...
随机推荐
- MFC程序最小化到系统托盘及其响应函数
预备知识: Windows API函数: WINSHELLAPI BOOL WINAPI Shell_NotifyIcon( DWORD dwMessage, PNOTIFYICONDATA pnid ...
- Linux运维到底是做什么的?在开始学习之前,你必须了解这些!
首先祝贺你选择学习Linux,你可能即将踏上Linux的工作之旅,出发之前,让我带你来看一看关于Linux和Linux运维的一切. Linux因其高效率.易于裁剪.应用广等优势,成为了当今中高端服务器 ...
- PyTorch学习笔记——softmax和log_softmax的区别、CrossEntropyLoss() 与 NLLLoss() 的区别、log似然代价函数
1.softmax 函数 Softmax(x) 也是一个 non-linearity, 但它的特殊之处在于它通常是网络中一次操作. 这是因为它接受了一个实数向量并返回一个概率分布.其定义如下. 定义 ...
- MRC转ARC(2)
春节前抽空花了一天的时间将手头的工程从MRC转成了ARC,然后陆陆续续地修复一部分因为转ARC引起的内存泄漏和崩溃,到目前为止工程也算是比较稳定了,抽空记上一笔.(虽说这种事情这辈子估计都只会做这么一 ...
- <Linux> 下安装和卸载JDK
安装 下载jdk https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 在local ...
- buf.equals()
buf.equals(otherBuffer) otherBuffer {Buffer} 返回:{Boolean} 返回一个 boolean 标识,无论 this 和 otherBuffer 是否具有 ...
- ubuntu 安装python 编程环境
1. 安装python sudo add-apt-repository ppa:fkrull/deadsnakessudo apt-get updatesudo apt-get install pyt ...
- day21 05 员工信息表
day21 05 员工信息表 假设有一个员工信息表,里面有每个员工的名字,id,年龄,电话,还有他们所作的工作,而有时候我们并不需要所有的信息,而想根据某些条件,寻找符合条件即可,即筛选, 比如想要筛 ...
- Java中的日期、时间操作
每次在处理日期时间的时候都要打开chrome查找一番,索性自己找一下满意的记录下来. 一.时间格式 // hh表示12小时制: HH表示24小时制 SimpleDateFormat format1 = ...
- uva 12096 The SetStack Computer(STL set的各种库函数 交集 并集 插入迭代器)
题意: 有5种操作: PUSH:加入“{}”空集合入栈. DUP:栈顶元素再入栈. UNION:出栈两个集合,取并集入栈. INTERSECT:出栈两个集合,取交集入栈. ADD:出栈两个集合,将先出 ...