Update support video and audio whitelist (#27)

Update support video and audio whitelist
This commit is contained in:
jonny 2020-09-27 21:56:48 +08:00 committed by GitHub
parent fe3a5f2eed
commit 32c722b849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3491,11 +3491,23 @@
case '=video':
if(href.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)){
return "<video src='"+ href + "' controls='controls' preload width=500></video>"
}else{
for(var i = 0; i< iframe_whitelist.length; i++){
if(href.match(iframe_whitelist[i])){
return "<video src='"+ href + "' controls='controls' preload width=500></video>"
}
}
}
break;
case '=audio':
if(href.match(/^.+.(mp3|wav|flac|m4a)$/)){
return "<audio src='"+ href + "' controls='controls'></audio>"
}else{
for(var i = 0; i< iframe_whitelist.length; i++){
if(href.match(iframe_whitelist[i])){
return "<audio src='"+ href + "' controls='controls'></audio>"
}
}
}
break;
case '=video_iframe':