用于html5视频插播广告的jQuery插件? [英] jQuery plugin for html5 video instream ads?
问题描述
html5视频是否有任何jQuery插件可以在视频中添加插播广告?
Are there any jQuery plugins for html5 video to insert instream ads into the video?
大多数闪存工作都是通过在特定时间戳暂停视频,播放广告流,然后恢复原始视频流来实现的。 html5的jquery字幕插件看起来非常相似,但不同。
Most of the flash ones work by pausing the video at a particular timestamp, and playing an ad stream, then resuming the original video stream. The jquery captions plugin for html5 seems very similar, but different.
推荐答案
我没有找到任何插件,但我已经修补了jCap以提供回调并添加了一个示例:
http: //github.com/irae/jCaps/blob/master/addsexample.html
I didn't find any plugins, but I've patched jCap to provide a callback and made an add example: http://github.com/irae/jCaps/blob/master/addsexample.html
$("#myVid").jCaps({
language: 'en',
languageChooser: false,
toggleButton: false,
onButton: false,
offButton: false,
interfaceImg: false,
transcriptButton:false,
showCaptions: true,
transcriptType: 'html',
transcriptsDiv: $('#transcripts'),
subtitleChangeCallback:function(oldV,newV) {
if(!addShown) {
addShown = true;
$('#myVid').get(0).pause();
setTimeout(function(){
$('#captions').text('');
$('#myVid').get(0).play();
},5*1000); // time to show add (5 seconds)
}
}
});
这不太理想。如果我是你,我已经从头开始了一个新的插件。在jCap的基础上建立起来并不困难。
This is not ideal. If I were you, I've started a new plugin from scratch just for that. It's not difficult to build on top of what's jCap already does.
这篇关于用于html5视频插播广告的jQuery插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!