Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quality change #2

Open
sankhadeeproy007 opened this issue Jul 8, 2019 · 4 comments
Open

Quality change #2

sankhadeeproy007 opened this issue Jul 8, 2019 · 4 comments
Labels
good first issue Good for newcomers

Comments

@sankhadeeproy007
Copy link

Hi, thanks for the package. Does this support the option to change the quality of the video?

@yjose
Copy link
Member

yjose commented Jul 8, 2019

Hi @sankhadeeproy007. Unfortunately, The package didn't support changing Quality of the Video for now.

The good news is you can add any Youtube Iframe function and should work correctly using react-native-webview-invoke

  • Step1: Export the function to the native side like the following :
//src/web/index.js

....

const createPlayer = () => {
....
}
invoke.define("createPlayer", createPlayer);

const changeQuality = (opts) => {
 //https://developers.google.com/youtube/iframe_api_reference#Playback_quality
 player.setPlaybackQuality(opts)
}

invoke.define("changeQuality", changeQuality);
  • Step2: Use changeQuality on Native-side
//src/mobile/YTWebView.tsx

....

export default class YTWebView extends Component<YTWebViewProps> {
	  
   ...

  _createPlayer = this.invoke.bind("createPlayer");
  _changeQuality = this.invoke.bind("changeQuality");


}

lets me know if you need more help to implement the option to change the quality.

@yjose yjose added the good first issue Good for newcomers label Jul 8, 2019
@sankhadeeproy007
Copy link
Author

Great! Thanks for the solution, I'll try that out.

@marksturm
Copy link

Heya - very nice lib! But really, where is the right place to call the _changeQuality ? That is really the missing part of this great lib

@ramkumar2098
Copy link

setPlaybackQuality is no longer supported.
https://developers.google.com/youtube/iframe_api_reference#october-24,-2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants
@marksturm @sankhadeeproy007 @yjose @ramkumar2098 and others