mirror of
https://github.com/mashirozx/sakura.git
synced 2024-11-22 23:08:14 +08:00
perf: optmize
This commit is contained in:
parent
b17576867f
commit
c0f0990ff0
@ -402,7 +402,7 @@ function get_qq_avatar(){
|
|||||||
$encrypted=$_GET["qq"];
|
$encrypted=$_GET["qq"];
|
||||||
if(isset($encrypted)){
|
if(isset($encrypted)){
|
||||||
$iv = str_repeat($sakura_privkey, 2);
|
$iv = str_repeat($sakura_privkey, 2);
|
||||||
$encrypted = urldecode(base64_decode($encrypted));
|
$encrypted = base64_decode(urldecode($encrypted));
|
||||||
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0, $iv);
|
$qq_number = openssl_decrypt($encrypted, 'aes-128-cbc', $sakura_privkey, 0, $iv);
|
||||||
preg_match('/^\d{3,}$/', $qq_number, $matches);
|
preg_match('/^\d{3,}$/', $qq_number, $matches);
|
||||||
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';
|
$imgurl='https://q2.qlogo.cn/headimg_dl?dst_uin='.$matches[0].'&spec=100';
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
* @date 2019.8.3
|
* @date 2019.8.3
|
||||||
*/
|
*/
|
||||||
mashiro_global.variables = new function () {
|
mashiro_global.variables = new function () {
|
||||||
|
this.has_hls = false;
|
||||||
this.skinSecter = true;
|
this.skinSecter = true;
|
||||||
}
|
}
|
||||||
mashiro_global.ini = new function () {
|
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() {
|
function coverVideoIni() {
|
||||||
if ($('video').hasClass('hls')) {
|
if ($('video').hasClass('hls')) {
|
||||||
$.getScript("https://cdn.jsdelivr.net/gh/mashirozx/Sakura@3.3.3/cdn/js/src/16.hls.js", function(){
|
if (mashiro_global.variables.has_hls){
|
||||||
var video = addComment.I('coverVideo');
|
loadHls();
|
||||||
var video_src = $('#coverVideo').attr('data-src');
|
}else{
|
||||||
if (Hls.isSupported()) {
|
$.getScript("https://cdn.jsdelivr.net/gh/mashirozx/Sakura@3.3.3/cdn/js/src/16.hls.js", function(){
|
||||||
var hls = new Hls();
|
loadHls();
|
||||||
hls.loadSource(video_src);
|
mashiro_global.variables.has_hls = true;
|
||||||
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();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//console.info('ini:coverVideoIni()');
|
//console.info('ini:coverVideoIni()');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user