成功读取tags

This commit is contained in:
Harvey Zack committed 2018-12-18 16:46:00 +08:00
1 parent 52458bb95e
commit 3a50f7ea86
8 files changed
+170 -18

No files matched your search

+2 -7
View File
@@ -19,17 +19,12 @@ body,
.part-top .config {
width: 500px;
display: flex;
margin-bottom: 20px;
}
.part-top .config .urlInput {
flex: 1;
outline: none;
}
.part-top .config .playBtn {
width: 50px;
width: 100%;
margin-bottom: 20px;
}
.part-top .artplayer {
+4 -1
View File
@@ -20,7 +20,10 @@
<div class="part-top">
<div class="config">
<input class="urlInput" type="text" value="https://blog.zhw-island.com/assets-cdn/video/one-more-time-one-more-chance-480p.flv">
<input class="playBtn" type="button" value="play">
<div class="btns">
<input class="playBtn" type="button" value="Play">
<input class="fileBtn" type="file">
</div>
</div>
<div class="artplayer"></div>
</div>
+12 -7
View File
@@ -1,11 +1,11 @@
'use strict';
(function() {
consola.creat({
target: '.part-bottom',
size: '100%',
zIndex: 99,
});
// consola.creat({
// target: '.part-bottom',
// size: '100%',
// zIndex: 99,
// });
console.info('Welcome, if you like it, consider star it, thank you.');
console.info('https://github.com/zhw2590582/ArtPlayer');
@@ -16,8 +16,9 @@
var $urlInput = document.querySelector('.urlInput');
var $playBtn = document.querySelector('.playBtn');
var $fileBtn = document.querySelector('.fileBtn');
function creatPlayer() {
function creatPlayer(file) {
Artplayer.instances.forEach(function(art) {
art.destroy(true);
});
@@ -28,7 +29,7 @@
type: 'flv',
customType: {
flv: function(video, url) {
this.plugins.artplayerPluginFlv.init(video, url);
this.plugins.artplayerPluginFlv.init(video, file || url);
},
},
plugins: [artplayerPluginFlv]
@@ -37,4 +38,8 @@
creatPlayer();
$playBtn.addEventListener('click', creatPlayer);
$fileBtn.addEventListener('change', () => {
const file = $fileBtn.files[0];
creatPlayer(file);
});
})();