Skip to content

Commit

Permalink
Support native FLV format
Browse files Browse the repository at this point in the history
  • Loading branch information
lwl12 committed Nov 29, 2018
1 parent 52cd5a3 commit 777d372
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions view/material/show/video.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
?>
<?php view::begin('content');?>
<link class="dplayer-css" rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.css">
<script src="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js"></script>
<div class="mdui-container-fluid">
<br>
<div id="dplayer"></div>
Expand All @@ -19,16 +18,18 @@
<textarea class="mdui-textfield-input"><video><source src="<?php e($url);?>" type="video/mp4"></video></textarea>
</div>
</div>
<?php if(pathinfo($item["name"], PATHINFO_EXTENSION) === 'flv') { e('<script src="https://cdn.jsdelivr.net/npm/flv.js/dist/flv.min.js"></script>'); } ?>
<script src="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js"></script>
<script>
const dp = new DPlayer({
container: document.getElementById('dplayer'),
lang:'zh-cn',
video: {
url: '<?php e($item['downloadUrl']);?>',
pic: '<?php @e($item['thumb']);?>',
type: 'auto'
type: '<?php e((pathinfo($item["name"], PATHINFO_EXTENSION) === 'flv') ? 'flv' : 'auto'); ?>'
}
});
</script>
<a href="<?php e($url);?>" class="mdui-fab mdui-fab-fixed mdui-ripple mdui-color-theme-accent"><i class="mdui-icon material-icons">file_download</i></a>
<?php view::end('content');?>
<?php view::end('content');?>

0 comments on commit 777d372

Please sign in to comment.