mirror of
				https://github.com/iv-org/invidious.git
				synced 2025-10-31 12:42:09 +00:00 
			
		
		
		
	Code easy to read by suggestion from code review
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
		| @@ -83,7 +83,20 @@ function return_message(message, target_window) { | ||||
|     } | ||||
|     if (message.message_kind === 'event') { | ||||
|         if (message.eventname === 'timeupdate' || message.eventname === 'loadedmetadata') { | ||||
|             additional_info['value'] = { getvolume: player.volume(), getduration: player.duration(), getcurrenttime: player.currentTime(), getplaystatus: player.paused(), getplaybackrate: player.playbackRate(), getloopstatus: player.loop(), getmutestatus: player.muted(), getfullscreenstatus: player.isFullscreen(), getavailableplaybackrates: options.playbackRates, gettitle: player_data.title, getplaylistindex: video_data.index, getplaylistid: video_data.plid }; | ||||
|             additional_info['value'] = { | ||||
|                 getvolume: player.volume(), | ||||
|                 getduration: player.duration(), | ||||
|                 getcurrenttime: player.currentTime(), | ||||
|                 getplaystatus: player.paused(), | ||||
|                 getplaybackrate: player.playbackRate(), | ||||
|                 getloopstatus: player.loop(), | ||||
|                 getmutestatus: player.muted(), | ||||
|                 getfullscreenstatus: player.isFullscreen(), | ||||
|                 getavailableplaybackrates: options.playbackRates, | ||||
|                 gettitle: player_data.title, | ||||
|                 getplaylistindex: video_data.index, | ||||
|                 getplaylistid: video_data.plid | ||||
|             }; | ||||
|         } | ||||
|     } | ||||
|     if (message.eventname === 'error') { | ||||
|   | ||||
| @@ -54,11 +54,7 @@ class invidious_embed { | ||||
|                 const instance_stats = await fetch(instance_origin + '/api/v1/stats'); | ||||
|                 if (instance_stats.ok) { | ||||
|                     const instance_stats_json = await instance_stats.json(); | ||||
|                     if (instance_stats_json.software.name === 'invidious') { | ||||
|                         return_status = true; | ||||
|                     } else { | ||||
|                         return_status = false; | ||||
|                     } | ||||
|                     return_status = (instance_stats_json.software.name === 'invidious'); | ||||
|                 } else { | ||||
|                     return_status = false; | ||||
|                 } | ||||
| @@ -139,7 +135,24 @@ class invidious_embed { | ||||
|         this.volume = 100; | ||||
|         this.loop = false; | ||||
|         this.playlistVideoIds = []; | ||||
|         this.eventobject = { ready: [], ended: [], error: [], ratechange: [], volumechange: [], waiting: [], timeupdate: [], loadedmetadata: [], play: [], seeking: [], seeked: [], playerresize: [], pause: [], statechange: [] }; | ||||
|  | ||||
|         this.eventobject = { | ||||
|             ready: [], | ||||
|             ended: [], | ||||
|             error: [], | ||||
|             ratechange: [], | ||||
|             volumechange: [], | ||||
|             waiting: [], | ||||
|             timeupdate: [], | ||||
|             loadedmetadata: [], | ||||
|             play: [], | ||||
|             seeking: [], | ||||
|             seeked: [], | ||||
|             playerresize: [], | ||||
|             pause: [], | ||||
|             statechange: [] | ||||
|         }; | ||||
|  | ||||
|         let replace_elemnt; | ||||
|         this.isPlaylistVideoList = false; | ||||
|         if (element === undefined || element === null) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 bonjinnorenka
					bonjinnorenka