-
Notifications
You must be signed in to change notification settings - Fork 587
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from mashirozx/dev
Dev
- Loading branch information
Showing
15 changed files
with
85 additions
and
70 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
* @date 2019.8.3 | ||
*/ | ||
mashiro_global.variables = new function () { | ||
this.has_hls = false; | ||
this.skinSecter = true; | ||
} | ||
mashiro_global.ini = new function () { | ||
|
@@ -523,25 +524,34 @@ function killCoverVideo() { | |
} | ||
} | ||
|
||
function loadHls(){ | ||
var video = addComment.I('coverVideo'); | ||
var video_src = $('#coverVideo').attr('data-src'); | ||
if (Hls.isSupported()) { | ||
var hls = new Hls(); | ||
hls.loadSource(video_src); | ||
hls.attachMedia(video); | ||
hls.on(Hls.Events.MANIFEST_PARSED, function () { | ||
video.play(); | ||
}); | ||
} else if (video.canPlayType('application/vnd.apple.mpegurl')) { | ||
video.src = video_src; | ||
video.addEventListener('loadedmetadata', function () { | ||
video.play(); | ||
}); | ||
} | ||
} | ||
|
||
function coverVideoIni() { | ||
if ($('video').hasClass('hls')) { | ||
$.getScript("https://cdn.jsdelivr.net/gh/mashirozx/[email protected]/cdn/js/src/16.hls.js", function(){ | ||
var video = addComment.I('coverVideo'); | ||
var video_src = $('#coverVideo').attr('data-src'); | ||
if (Hls.isSupported()) { | ||
var hls = new Hls(); | ||
hls.loadSource(video_src); | ||
hls.attachMedia(video); | ||
hls.on(Hls.Events.MANIFEST_PARSED, function () { | ||
video.play(); | ||
}); | ||
} else if (video.canPlayType('application/vnd.apple.mpegurl')) { | ||
video.src = video_src; | ||
video.addEventListener('loadedmetadata', function () { | ||
video.play(); | ||
}); | ||
} | ||
}); | ||
if (mashiro_global.variables.has_hls){ | ||
loadHls(); | ||
}else{ | ||
$.getScript("https://cdn.jsdelivr.net/gh/mashirozx/[email protected]/cdn/js/src/16.hls.js", function(){ | ||
loadHls(); | ||
mashiro_global.variables.has_hls = true; | ||
}); | ||
} | ||
//console.info('ini:coverVideoIni()'); | ||
} | ||
} | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.