Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
Fix crash (#12)
Browse files Browse the repository at this point in the history
* Missing methods

* throw error

* remove types

* update Youtube.js

* update TrackPlayer.js
  • Loading branch information
eliyya committed Aug 3, 2023
1 parent d832629 commit 34a18b3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/TrackPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class TrackPlayer extends EventEmitter{
async start(){
if(!await this.load_streams() || !this.player) /* destroy could have been called while waiting */
return;
if(this.normalize_volume)
if(this.normalize_volume && this.stream.volume)
this.player.setVolume(this.stream.volume);
try{
this.player.setURL(this.stream.url, this.stream.is_file);
Expand Down
3 changes: 2 additions & 1 deletion src/api/Youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ const api = new class YoutubeAPI{
constructor(){
this.innertube_client = {
clientName: 'WEB',
clientVersion: '2.20220331.06.00',
clientVersion: '2.20220918',
gl: 'US',
hl: 'en'
};
Expand All @@ -284,6 +284,7 @@ const api = new class YoutubeAPI{
options.headers.origin = `https://${origin}.youtube.com`;

if(path == 'player'){
body.params = '2AMBCgIQBg';
body.contentCheckOk = true;
body.racyCheckOk = true;
body.context.client.clientName = 'ANDROID';
Expand Down

0 comments on commit 34a18b3

Please sign in to comment.