当前位置: 首页 > 工具软件 > FlowPlayer > 使用案例 >

DzzOffice_flowplayer播放器更改

栾和玉
2023-12-01

确认安装:应用市场-flowplayer播放器
代码目录/dzz/flowplayer
更改文件index.php
以Dplayer为例

<!doctype html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <!-- player skin -->
   <link rel="stylesheet" type="text/css" href="<?php echo MOD_PATH;?>/skin.css" />
   
   <style>
   /* site specific styling */
   html ,body{width:100%;height:100%;overflow:hidden;margin:0;padding:0;}
   body {
      font: 12px "Myriad Pro", "Lucida Grande", "Helvetica Neue", sans-serif;
      text-align: center;
      padding-top: 0;
      color: #999;
      background-color: #333333;
	  
   }
   /* custom player skin */
   /*.flowplayer .fp-controls { background-color: rgba(17, 17, 17, 1)}*/
   .flowplayer .fp-timeline { background-color: rgba(204, 204, 204, 1)}
   .flowplayer .fp-progress { background-color: rgba(0, 167, 200, 1)}
   .flowplayer .fp-buffer { background-color: rgba(249, 249, 249, 1)}
   .flowplayer { background:#000}
   .fp-header{display:none}
   </style>
   <!--注释
   <script type="text/javascript" src="static/jquery/jquery.min.js"></script>
-->
   <!-- flowplayer javascript component -->
   <!--注释
   <script src="<?php echo MOD_PATH;?>/flowplayer.min.js"></script>
-->
<!--增加-->
    <script src="https://cdn.jsdelivr.net/npm/flv.js/dist/flv.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dashjs/dist/dash.all.min.js"></script>
    <script src="https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js"></script>
<!--增加-->
</head>
<body><?php 
$path=dzzdecode($_GET['path']);
$patharr=explode(':',$path);
if($patharr[0]=='ftp'){
	$src=$_G['siteurl'].DZZSCRIPT.'?mod=io&op=getStream&path='.rawurldecode($_GET['path']).'&n=play.'.$_GET['ext'];
}else{
	$src=IO::getFileUri($path);
	$src=str_replace('-internal.aliyuncs.com','.aliyuncs.com',$src);
}
if($_GET['ext']=='mp4'){
	$type='video/mp4';
}elseif($_GET['ext']=='flv' || $_GET['ext']=='m4v'){
	$type='video/flash';
}elseif($_GET['ext']=='mp3'){
	$type='audio/mp3';
}elseif($_GET['ext']=='wav' || $_GET['ext']=='flac' ){
	$type='audio/x-wav';
}elseif($_GET['ext']=='webm'){
	$type='video/webm';
}elseif($_GET['ext']=='ogv' || $_GET['ext']=='ogg'){
	$type='video/ogg';
}elseif($_GET['ext']=='m3u8' || $_GET['ext']=='HLS'){
	$type='application/x-mpegurl';
}
?>

<!--注释
<div class="flowplayer play-button fp-slim fp-outlined fp-mute" data-ratio="0.5625" style="height:100%;width:100%;postion:absolute;left:0;top:0;overflow:hidden"></div>
-->
<!--注释
  <video autoplay>
     <source  type="<?php echo $type ?>" src="<?php echo $src;?>">
  </video>
-->
<!--注释
<div id="dplayer"></div>
-->
<!--增加-->
<div id="dplayer" class="flowplayer play-button fp-slim fp-outlined fp-mute" data-ratio="0.5625" style="height:100%;width:100%;postion:absolute;left:0;top:0;overflow:hidden"></div>
<script type="text/javascript">
const dp = new DPlayer({
    container: document.getElementById('dplayer'),
    autoplay: false,
    theme: '#FADFA3',
    loop: true,
    lang: 'zh-cn',
    screenshot: true,
    hotkey: true,
    preload: 'auto',
    volume: 0.8,
    mutex: true,
    video: {
        url: '<?php echo $src;?>',
        type:'<?php echo $type ?>',
    },
});
</script>
<!--增加-->
</body>
</html>
 类似资料: