停止播放JWPlayer广告 [英] Stop JWPlayer ad playback

查看:102
本文介绍了停止播放JWPlayer广告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在播放广告时,我似乎无法使jwplayer (version 6)停止播放. jwplayer().stop() and pause()完全不执行任何操作.

I can't seem to make jwplayer (version 6) stop playback while it's playing an ad. jwplayer().stop() and pause() does absolutely nothing.

有没有特定于广告的播放控制方法?在文档中找不到它们.

Are there any ad-specific playback control methods? Can't find them in the documents.

推荐答案

对于非VPAID广告

您可以通过调用jwplayer().play()暂停广告.

a.要查看此解决方法,您可以使用以下测试页: http ://support.jwplayer.com/customer/portal/articles/1431665-basic-preroll-video-ads

a. To see this workaround, you can use this test page: http://support.jwplayer.com/customer/portal/articles/1431665-basic-preroll-video-ads

b.如果要使用此技术,则需要了解播放器中广告的活动状态,因为您可能最终会使广告恢复播放而不是暂停(这与您想要的相反).您的第一个倾斜度可能是jwplayer().getState(),但这将不起作用,因为这将返回视频内容的状态,而不是广告的状态.要解决此问题,您可以通过监听onAdPlay钩子及其同级元素来手动跟踪广告的状态.

b. If you want to use this technique, you need to know the active state of the ad in the player, because you might end up making the ad resume and not pause (which would be the opposite of what you want). Your first inclination might be jwplayer().getState() but this won't work because that will return the state of the video content and NOT the state of the ad. To work around this issue, you can keep track of the ad's state manually by listening to the onAdPlay hook and it's siblings.

您根本无法暂停/停止广告.

You can't pause/stop the ad at all.

回答Ethan关于要复制页面的问题:

To answer Ethan's question about a page to reproduce:

i.转到 http://support.jwplayer.com/customer /portal/articles/1434330-vpaid-interactive-pre-roll

ii.打开开发者控制台

ii. Open the developer console

iii.执行以下命令:jwplayer().play()并注意播放器如何开始播放广告(很好)

iii. Execute this command: jwplayer().play() and note how the player starts playing the ad (which is good)

iv.执行以下命令:jwplayer.play()并注意播放器不会暂停(这很糟糕)

iv. Execute this command: jwplayer.play() and note how the player won't pause (which is bad)

对于步骤"iv",您也可以尝试jwplayer.pause()jwplayer.stop().他们都不会停止VPAID广告.

For step "iv", you can also try jwplayer.pause() and jwplayer.stop(). None of them will stop the VPAID ad.

我正在与jwplayer合作处理此问题,但是对于VPAID广告,这是一种变通方法,我在其中取得了一些成功:

I am working with jwplayer on this issue, but for a VPAID ad here is a workaround which I've had some success with:

jwplayer().callInternal("jwCallVPAID", "pauseAd");

注意:仅当VPAID广告素材实现了暂停"功能(该功能可能没有从外部调用)时,此功能才起作用.

Note: This will only work if the VPAID creative has implemented a "pause" function which can be called externally, which they might not have.

您也可以以类似的方式调用"resumeAd"和"stopAd".

You can also call "resumeAd" and "stopAd" in a similar fashion.

这篇关于停止播放JWPlayer广告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆