improve return data

Co-authored-by: AHOHNMYC <24810600+AHOHNMYC@users.noreply.github.com>
This commit is contained in:
bonjinnorenka 2023-08-30 00:40:03 +09:00 committed by GitHub
parent 8239d1da5d
commit 2134dd89d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 7 deletions

View File

@ -310,12 +310,7 @@ class invidious_embed{
search_params.append('widgetid',invidious_embed.widgetid);
this.widgetid = invidious_embed.widgetid;
invidious_embed.widgetid++;
if(autoplay){
search_params.append('autoplay',1);
}
else{
search_params.append('autoplay',0);
}
search_params.append('autoplay', Number(autoplay));
if(this.option_playerVars!==undefined){
for(var x in this.option_playerVars){
if(x!=='autoplay'&&x!=='start'&&x!=='end'){
@ -361,7 +356,7 @@ class invidious_embed{
}
async getVideoEmbedCode(){
var title = await this.getVideoTitle();
return '<iframe width="560" height="315" src="' + this.target_origin + "/embed/" + this.videoId + '" title="' + title.replace('"','') + '" frameborder="0" allow="autoplay;encrypted-media;picture-in-picture; web-share" allowfullscreen></iframe>';
return '<iframe width="560" height="315" src="' + this.target_origin + '/embed/' + this.videoId + '" title="' + title.replace('"',"'") + '" frameborder="0" allow="autoplay;encrypted-media;picture-in-picture;web-share" allowfullscreen></iframe>';
}
getCurrentTime(){
return this.promise_send_event('getcurrenttime');