Skip to content

Instantly share code, notes, and snippets.

@0x333333
Last active November 26, 2015 10:03
Show Gist options
  • Save 0x333333/2b6d741093cbc68faef9 to your computer and use it in GitHub Desktop.
Save 0x333333/2b6d741093cbc68faef9 to your computer and use it in GitHub Desktop.
// Hide the keyboard div
// 隐藏键盘等遮罩层
$(".keyboard").hide();
$(".waitingLayer").hide();
$(".wrapper-shadow").hide();
// Get player object
// 获取播放器对象,并设置为播放
var v = jwplayer("video");
// Force the player to play
v.play(!0);
// Force the player to play in every 1 second
// 有时候当网页失去焦距之后,比如浏览其他网页
// 这个时候视频会暂停播放
// 有一个粗暴的解决方案:
setInterval(function() {v.play(!0);}, 1000);
// If you want to change current progress
// Get current position, change the position with seek()
// 获取当前播放点的时间
v.getPosition();
// 将视频调整到300播放点
v.seek(300);
// 将视频往后调整300个时间点
v.seek(v.getPosition()+300);
// 其余方法类似
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment