debug
This commit is contained in:
355
code/app/home/view/videoDadi/video/getVideoPlayUrl.html
Normal file
355
code/app/home/view/videoDadi/video/getVideoPlayUrl.html
Normal file
@@ -0,0 +1,355 @@
|
||||
{extend name="base" /}
|
||||
|
||||
|
||||
{block name="get-data"}
|
||||
|
||||
{if $Request.route.intVideoId}
|
||||
{video:info v_id="$Request.route.intVideoId" n_key="arrVideo" n_forge_id="$Request.route.intForgeId" /}
|
||||
{else}
|
||||
{video:info v_id="$DomainModel->info_id" n_key="arrVideo" n_forge_id="0" /}
|
||||
{/if}
|
||||
{site:grm page_code="h5_video_info" diff="$arrVideo.v_id" num="120" g_key="arrGrm" /}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="title"}
|
||||
{if $DomainModel->info_id == $Request.route.intVideoId || empty($Request.route.intVideoId)}
|
||||
{site:replace code="INDEX@INDEX@TITLE"}
|
||||
{else}
|
||||
{site:replace code="NOVEL@GETNOVELINFO@TITLE" diff="$Request.route.intVideoId" /}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
|
||||
{block name="keywords"}
|
||||
{if $DomainModel->info_id == $Request.route.intVideoId || empty($Request.route.intVideoId)}
|
||||
{site:replace code="INDEX@INDEX@KEYWORDS"}
|
||||
{else}
|
||||
{site:replace code="NOVEL@GETNOVELINFO@KEYWORDS" diff="$Request.route.intVideoId"}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="description"}
|
||||
{if $DomainModel->info_id == $Request.route.intVideoId || empty($Request.route.intVideoId)}
|
||||
{site:replace code="INDEX@INDEX@DESCRIPTION"}
|
||||
{else}
|
||||
{site:replace code="NOVEL@GETNOVELINFO@DESCRIPTION" diff="$Request.route.intVideoId"}
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block name="head-css"}
|
||||
<link rel="stylesheet" href="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/dplayer/1.24.0/DPlayer.min.css">
|
||||
<style type="text/css">
|
||||
.stui-player__head {
|
||||
display: none;
|
||||
}
|
||||
.dplayer-video-wrap{
|
||||
max-height: 480px;
|
||||
}
|
||||
video {
|
||||
max-height: 480px;
|
||||
}
|
||||
|
||||
@media (max-width:767px) {
|
||||
body {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
.stui-header__top {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.stui-player__head {
|
||||
display: block;
|
||||
padding: 15px;
|
||||
background-color: #333;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.stui-player__head a {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="head-js"}
|
||||
<script type="text/javascript"
|
||||
src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/hls.js/1.1.5-0.canary.8257/hls.min.js" defer></script>
|
||||
<script type="text/javascript" src="https://lf26-cdn-tos.bytecdntp.com/cdn/expire-1-M/dplayer/1.26.0/DPlayer.min.js"
|
||||
defer></script>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-wide-75 col-xs-1 padding-0">
|
||||
<div class="stui-pannel stui-pannel-bg clearfix">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel-bd">
|
||||
<div class="stui-player col-pd">
|
||||
<div class="stui-player__head">
|
||||
<span class="pull-right">
|
||||
<a style="color: rgb(202, 129, 28);" href="/">
|
||||
<i class="iconfont icon-home"></i>
|
||||
</a>
|
||||
</span>
|
||||
<a style="color: rgb(233, 161, 136);" href="javascript:;"
|
||||
onclick="window.history.go(-1)">
|
||||
<i class="iconfont icon-back"></i>
|
||||
返回
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="dplayer-prent">
|
||||
<div id="dplayer" class="dplayer" muted=“muted” style="margin-top: 5px;"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="stui-player__detail detail">
|
||||
<ul class="more-btn">
|
||||
<li>
|
||||
<a style="color: rgb(204, 180, 44);" href="javascript:;" class="btn btn-default"
|
||||
onclick="window.location.reload()">
|
||||
刷新
|
||||
<i class="icon iconfont icon-refresh hidden-xs"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a style="color: rgb(14, 41, 1);" class="btn btn-default copylink"
|
||||
href="javascript:;">
|
||||
分享
|
||||
<i class="icon iconfont icon-share hidden-xs"></i>
|
||||
</a>
|
||||
</li>
|
||||
{if $Request.route.intPlayIndex > 1}
|
||||
<li>
|
||||
<a style="color: rgb(30, 99, 7);" class="btn btn-default"
|
||||
href="//{$arrVideo.v_name_en}-1-{$Request.route.intPlayIndex-1}.html">
|
||||
<i class="icon iconfont icon-back hidden-xs"></i>
|
||||
上一集
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{if $Request.route.intPlayIndex < 100} <li>
|
||||
<a style="color: rgb(246, 155, 213);" class="btn btn-default"
|
||||
href="//{$arrVideo.v_name_en}-1-{$Request.route.intPlayIndex+1}.html">
|
||||
下一集
|
||||
<i class="icon iconfont icon-more hidden-xs"></i>
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
<h1 class="title"><a style="color: rgb(244, 139, 75);"
|
||||
href="//{$arrVideo.v_name_en}.html">
|
||||
《{$arrVideo.v_name}》
|
||||
</a>
|
||||
</h1>
|
||||
<p class="data margin-0">
|
||||
<span class="text-muted">类型:</span>
|
||||
<a style="color: rgb({:mt_rand(0,255)}, {:mt_rand(0,255)}, {:mt_rand(0,255)});"
|
||||
href="//-------------.html" target="_blank">{$arrVideo.v_category}</a>
|
||||
|
||||
|
||||
<span class="split-line"></span>
|
||||
<span class="text-muted">地区:</span>
|
||||
<a style="color: rgb(240, 3, 132)" href="//--{$arrVideo.v_area}-----------.html"
|
||||
target="_blank">{$arrVideo.v_area}</a>
|
||||
|
||||
<span class="split-line"></span>
|
||||
<span class="text-muted">年份:</span>
|
||||
<a style="color: rgb(102, 158, 132)" href="//-------------{$arrVideo.v_year}.html"
|
||||
target="_blank">{$arrVideo.v_year}</a>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{foreach $arrVideo.v_play_url as $key=>$arrPlayUrlType }
|
||||
<div class="stui-pannel stui-pannel-bg clearfix">
|
||||
<div class="stui-pannel-box b playlist mb">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head bottom-line active clearfix"><span
|
||||
class="more text-muted pull-right">无需安装任何插件</span>
|
||||
<h3 class="title"><img src="/template/videodadi/icon/icon_30.png">{$key}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel_bd col-pd clearfix">
|
||||
<ul class="stui-content__playlist clearfix">
|
||||
{volist name='$arrPlayUrlType' id='arrPlayUrl' key='index'}
|
||||
<li class="{if $index == $Request.route.intPlayIndex}active{/if}">
|
||||
<a href="//{$arrPlayUrl.name}-1-{$index}.html" m3u8="{$arrPlayUrl.url}">{$arrPlayUrl.name}</a>
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/foreach}
|
||||
<div class="stui-pannel stui-pannel-bg clearfix" id="desc">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head active bottom-line clearfix">
|
||||
<h3 class="title"><img src="/template/videodadi/icon/icon_30.png">剧情简介</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel_bd">
|
||||
<h3>【{$arrVideo.v_name}】</h3>
|
||||
<p class="col-pd">
|
||||
{$arrVideo.v_description|raw}
|
||||
<a href="//.html">{}</a>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="stui-pannel stui-pannel-bg clearfix">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head active bottom-line clearfix">
|
||||
<h3 class="title"><img src="/template/videodadi/icon/icon_6.png">猜你喜欢</h3>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="stui-pannel_bd">
|
||||
<ul class="stui-vodlist__bd clearfix">
|
||||
{video:list count="12" sort_type="news" d_key="key" d_val="Video" cache_life="86400"}
|
||||
{include file="public/video-list-shu" /}
|
||||
{/video:list}
|
||||
|
||||
</ul>
|
||||
<ul class="stui-vodlist__text col-pd clearfix hidden-xs">
|
||||
{video:list count="12" sort_type="news" d_key="key" d_val="Video" cache_life="86400"}
|
||||
{include file="public/video-list-text2" /}
|
||||
|
||||
{/video:list}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-wide-25 col-xs-1 stui-pannel-side hidden-sm hidden-xs">
|
||||
|
||||
<div class="stui-pannel stui-pannel-bg clearfix">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head active bottom-line clearfix">
|
||||
<h3 class="title"><img src="/template/videodadi/icon/icon_12.png">喜剧片周榜单</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel_bd">
|
||||
<ul class="stui-vodlist__text col-pd clearfix">
|
||||
{video:ranklist count="10" sort_type="weekly" d_key="key" d_val="Video" cache_life="86400"}
|
||||
{include file="public/video-list-phb" /}
|
||||
{/video:ranklist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel stui-pannel-bg clearfix">
|
||||
<div class="stui-pannel-box">
|
||||
<div class="stui-pannel_hd">
|
||||
<div class="stui-pannel__head active bottom-line clearfix">
|
||||
<h3 class="title"><img src="/template/videodadi/icon/icon_12.png">喜剧片月榜单</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="stui-pannel_bd">
|
||||
<ul class="stui-vodlist__text col-pd clearfix">
|
||||
{video:ranklist count="10" sort_type="weekly" d_key="key" d_val="Video" cache_life="86400"}
|
||||
{include file="public/video-list-phb" /}
|
||||
{/video:ranklist}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
{block name="customize"}
|
||||
<script>
|
||||
var intPlayUrlIndex = '{$Request.route.intPlayIndex}'
|
||||
var strPlayType = '{$Request.route.strPlayType}'
|
||||
var intJumpTimeFirst = 1;
|
||||
var intJumpTimeTwoStart = 1;
|
||||
var intJumpTimeTwoEnd = 1;
|
||||
var arrPlayUrl = {:json_encode($arrVideo.v_play_url)};
|
||||
var ActivePlayUrl = arrPlayUrl[strPlayType][intPlayUrlIndex - 1]
|
||||
var strPlayUrl = ActivePlayUrl.url
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
console.log(strPlayUrl)
|
||||
|
||||
initDPlayer(strPlayUrl)
|
||||
function initDPlayer(strPlayUrl) {
|
||||
let DomDPlayer = document.getElementById('dplayer')
|
||||
videoPlayer = new DPlayer({
|
||||
container: DomDPlayer,
|
||||
autoplay: true,
|
||||
screenshot: false,
|
||||
//logo: dplayerLogo,
|
||||
video: {
|
||||
url: strPlayUrl,
|
||||
type: 'hls',
|
||||
},
|
||||
pluginOptions: {
|
||||
hls: {
|
||||
maxBufferLength: 600,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
videoPlayer.play()
|
||||
|
||||
// 监听全屏进入事件
|
||||
videoPlayer.on('fullscreen', function () {
|
||||
DomDPlayer.classList.add("dp-fullscreen");
|
||||
// 设置视频元素的样式,取消 max-height
|
||||
document.querySelector("video").style.maxHeight = "none";
|
||||
});
|
||||
|
||||
// 监听全屏退出事件
|
||||
videoPlayer.on('fullscreen_cancel', function () {
|
||||
DomDPlayer.classList.remove("dp-fullscreen");
|
||||
// 恢复 max-height 为 480px
|
||||
document.querySelector("video").style.maxHeight = "480px";
|
||||
});
|
||||
|
||||
videoPlayer.on('error', function () {
|
||||
|
||||
});
|
||||
videoPlayer.on('play', function () {
|
||||
console.log('play')
|
||||
// 确保视频准备好后再进行跳转
|
||||
// setTimeout(() => {
|
||||
// if (videoPlayer.video.readyState >= 2) {
|
||||
// // readyState >= 2 表示元数据已加载
|
||||
// videoPlayer.seek(20); // 跳转到 20 分钟
|
||||
// }
|
||||
// }, 1000); // 等待一会儿确保视频已开始
|
||||
});
|
||||
// 监听当前播放时间
|
||||
videoPlayer.on('timeupdate', function () {
|
||||
if (videoPlayer.video.currentTime < intJumpTimeFirst) { // 当前时间小于 20 秒
|
||||
videoPlayer.seek(intJumpTimeFirst); // 跳过到 20 秒
|
||||
}
|
||||
if (videoPlayer.video.currentTime >= intJumpTimeTwoStart && videoPlayer.video.currentTime < intJumpTimeTwoEnd) { // 当前时间小于 20 秒
|
||||
videoPlayer.seek(intJumpTimeTwoEnd + 1); // 跳过到 20 秒
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
// 页面加载时执行
|
||||
// $(document).ready(function () {
|
||||
// let vod_name = $("h1 a").text();
|
||||
// let vod_url = window.location.pathname;
|
||||
// let vod_part = $(".stui-content__playlist .active a").text();
|
||||
// addHistory(vod_name, vod_url, vod_part)
|
||||
// history();
|
||||
// });
|
||||
</script>
|
||||
{/block}
|
||||
Reference in New Issue
Block a user