mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
96 lines
3.0 KiB
HTML
96 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
|
|
<head>
|
|
<title>ArtPlayer</title>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0,minimal-ui">
|
|
<meta name="keywords" content="artplayer">
|
|
<meta name="description" content="artplayer">
|
|
<link rel="shortcut icon" href="./img/favicon.ico">
|
|
<link rel="stylesheet" href="./css/normalize.css">
|
|
<link rel="stylesheet" href="./css/app.css">
|
|
<link rel="stylesheet" href="./css/artplayer.css">
|
|
</head>
|
|
|
|
<body>
|
|
<div class="app">
|
|
<div class="title">ArtPlayer</div>
|
|
<div class="description">ArtPlayer is a modern HTML5 video player</div>
|
|
<div class="github">
|
|
<a href="https://github.com/zhw2590582/artplayer">GITHUB</a>
|
|
</div>
|
|
<div class="artplayer-app"></div>
|
|
</div>
|
|
<script src="./js/artplayer.js"></script>
|
|
<script>
|
|
var player = new Artplayer({
|
|
container: '.artplayer-app',
|
|
url: './video/one-more-time-one-more-chance.mp4',
|
|
poster: './img/one-more-time-one-more-chance.jpg',
|
|
subtitle: {
|
|
url: './subtitle/one-more-time-one-more-chance.srt',
|
|
},
|
|
thumbnails: {
|
|
url: './img/thumbnails.png',
|
|
width: 190,
|
|
height: 107
|
|
},
|
|
highlight: [
|
|
{
|
|
time: 60,
|
|
text: 'One more chance'
|
|
},
|
|
{
|
|
time: 120,
|
|
text: '谁でもいいはずなのに'
|
|
},
|
|
{
|
|
time: 180,
|
|
text: '夏の想い出がまわる'
|
|
},
|
|
{
|
|
time: 240,
|
|
text: 'こんなとこにあるはずもないのに'
|
|
},
|
|
{
|
|
time: 300,
|
|
text: '--终わり--'
|
|
}
|
|
]
|
|
});
|
|
|
|
player.layers.add({
|
|
index: 1,
|
|
name: 'your-name',
|
|
html: '<img style="width: 100px" src="./img/your-name.png">',
|
|
style: {
|
|
'top': '20px',
|
|
'right': '20px',
|
|
'opacity': '.9'
|
|
}
|
|
}, dom => {
|
|
dom.addEventListener('click', () => {
|
|
player.destroy(true);
|
|
new Artplayer({
|
|
autoplay: true,
|
|
container: '.artplayer-app',
|
|
url: './video/you-name.mp4',
|
|
})
|
|
});
|
|
});
|
|
|
|
// console.dir(Artplayer);
|
|
|
|
console.log(player);
|
|
|
|
// Artplayer.config.video.events.forEach(item => {
|
|
// player.on('video:' + item, event => {
|
|
// console.log('video', event);
|
|
// });
|
|
// });
|
|
</script>
|
|
</body>
|
|
|
|
</html> |