Authored by 2586703@qq.com

Merge branch 'ly_develop' into develop

<script id="side-related-posts" type="x-tmpl-mustache">
<script id="bottom-related-posts" type="x-tmpl-mustache">
\{{# relatedPost}}
<div class="side-related-posts">
<div class="related-posts">
<h2>新品播报</h2>
<ul class="postslist clearfix">
{{> detail/related_post}}
... ...
<script id="side-related" type="x-tmpl-mustache">
{{# relatedPost}}
<script id="side-related-posts" type="x-tmpl-mustache">
\{{# relatedPost}}
<div class="side-related-posts">
<h2>热播</h2>
<ul class="side-postslist">
<ul class="postslist">
{{> detail/related_post}}
</ul>
</div>
{{/ relatedPost}}
\{{/ relatedPost}}
</script>
\ No newline at end of file
... ...
{{# video}}
<div class="detail-video">
<div id="wx_pic" style="width:0px; height:0px; overflow:hidden"><img src=""></div>
<div class="videoPlaceholder">
<div class="video-wrap">
<a href="javascript:;" class="video-close-btn"></a>
{{> common/video}}
</div>
</div>
{{/ video}}
... ...
... ... @@ -2,7 +2,7 @@
<li class="clearfix">
<a href="\{{link}}" target="_blank">
<div class="pic">
<img src="\{{coverImage}}" alt="">
<img src="\{{cover}}" alt="">
\{{# isVideo}}
<span class="play-icon"></span>
\{{/ isVideo}}
... ...
... ... @@ -3,6 +3,39 @@
seajs.use(['js/channel/detail', 'js/public'], function(detail) {
if (detail) {
detail.init();
detail.videoMiniPlayer();
// IPAD上面的视频处理
if (navigator.userAgent.indexOf("iPad") !== -1) {
// 封面视频播放器替换为H5的VIDEO标签
if (!!$(".video-wrap").find("object").size()) {
$(".video-wrap").find("object").hide();
$("#video-ipad").show();
}
// 隐藏老格式的手机视频
if (!!$('.content-mobile-flash').size()) {
$('.content-mobile-flash').hide();
}
// 内容中视频播放器替换为H5的VIDEO标签
if (!!$(".text-body").find("object").size()) {
var defaultCover = $(".detail-body").attr("cover-url");
var playHref = "",
videoUrl = "",
videoCover = "",
videoHtml = "";
$(".text-body").find("object").each(function() {
playHref = $(this).find('embed').attr('src');
videoUrl = tools.request('url', playHref);
videoCover = tools.request('coverpic', playHref);
if (videoCover === "") {
videoCover = defaultCover;
}
videoCover = videoCover.replace(/%3A/g, ':').replace(/%2F/g, '/');
videoHtml = '<video controls="controls" preload="auto" width="700px" height="394px" poster="' + videoCover + '">' + '<source src="' + videoUrl + '" type="video/mp4">' + '</video>';
$(this).replaceWith(videoHtml);
});
}
}
}
... ...