Zi 字媒體
2017-07-25T20:27:27+00:00
[美中貿戰SM 全球經濟被玩殘] ~ 破解 LINE 影片下載 & 本地網頁播放(Html5 Video Playlist)
資料來源:
影片: https://today.line.me/tw/pc/article/美中貿戰SM+全球經濟被玩殘-LLMYa2
下載方法: http://jashliao.eu/wordpress/2018/01/01/簡易線上多段ts影片下載方法分享利用ffmpeg合併m3u8串流/
Playlist code: https://github.com/totymedli/html5-video-playlist-prototype
自己GITHUB: https://github.com/jash-git/Html5-Video-Playlist
實際影片播放:
OnLine片段程式碼
var player = document.getElementById('player')
var string1="https://github.com/jash-git/Html5-Video-Playlist/blob/master/code/videos/ts2mp4/"
var string2="?raw=true"
var playlist = [
"01.mp4",
"02.mp4",
"03.mp4",
"04.mp4",
"05.mp4",
"06.mp4",
"07.mp4",
"08.mp4",
"09.mp4",
"10.mp4",
"11.mp4",
"12.mp4",
"13.mp4",
"14.mp4",
"15.mp4",
"16.mp4",
"17.mp4",
]
var activeVideo = 0
var fileurl = string1 + playlist[activeVideo]+ string2
player.src = fileurl
player.addEventListener('ended', function(e) {
// update the new active video index
activeVideo = (++activeVideo) % playlist.length
var string1="https://github.com/jash-git/Html5-Video-Playlist/blob/master/code/videos/ts2mp4/"
var string2="?raw=true"
var fileurl = string1 + playlist[activeVideo]+ string2
player.src = fileurl
player.play()
})
HTML程式碼:
Video Element src Demo
var player = document.getElementById('player') var string1="https://github.com/jash-git/Html5-Video-Playlist/blob/master/code/videos/ts2mp4/" var string2="?raw=true"
var playlist = [
"01.mp4",
"02.mp4",
"03.mp4",
"04.mp4",
"05.mp4",
"06.mp4",
"07.mp4",
"08.mp4",
"09.mp4",
"10.mp4",
"11.mp4",
"12.mp4",
"13.mp4",
"14.mp4",
"15.mp4",
"16.mp4",
"17.mp4",
"18.mp4",
"19.mp4",
"20.mp4",
]
var activeVideo = 0 var fileurl = string1 + playlist[activeVideo]+ string2
player.src = fileurl
player.addEventListener('ended', function(e) {
// update the new active video index
activeVideo = (++activeVideo) % playlist.length var string1="https://github.com/jash-git/Html5-Video-Playlist/blob/master/code/videos/ts2mp4/" var string2="?raw=true" var fileurl = string1 + playlist[activeVideo]+ string2
player.src = fileurl
player.play()
})
PS. Playlist code 有 標準 mp4/m3u8的測試影片原始檔片段
寫了
5860316篇文章,獲得
23313次喜歡