文章最后更新时间:2024年05月17日
广告收入一直以来都是网站和APP运营者的主要收入来源之一,对于视频站点来说有过之而无不及,所以有一个带暂停贴片广告功能的播放器就变得很重要了,今天我们来看看CKplayer播放器是如何实现暂停贴片广告功能的。
使用比较广泛的H5播放器CKplayer提供的暂停贴片广告方式有两种:
1,图片贴片广告
2,容器DIY广告
现在我们来看看实现暂停贴片广告功能的步骤
1,在页面中加入广告元素的类名
.adpause{
width: 90%;
height: 90%;
max-width: 580px;
max-height: 360px;
color: #FFF;
position: absolute;
background: #07141E;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
font-size: 30px;
line-height: 38px;
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
-webkit-box-sizing:border-box; /* Safari */
padding: 50px;
display: none;
}
2,在页面中加入一个广告DIV容器
<div class="adpause">暂停广告<br />这是一个普通的DIV层,可以放置任意内容</div>
3,在CKplayer播放器中加入广告参数
此处为隐藏内容,请评论后查看隐藏内容,谢谢!
文章版权声明:除非注明,否则均为十八码原创文章,转载或复制请以超链接形式并注明出处。
发表评论