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

How to get latest iframe Youtube js? #10

Open
kesha-antonov opened this issue Sep 18, 2019 · 5 comments
Open

How to get latest iframe Youtube js? #10

kesha-antonov opened this issue Sep 18, 2019 · 5 comments

Comments

@kesha-antonov
Copy link

Hey!

Thanks for the awesome lib!
How to get updated iframe api that you hold in html var?
https://github.com/barmej/react-native-youtube-player/blob/master/src/mobile/YTWebView.tsx#L64-L65

I'm making custom component based on your lib and setPlaybackRate is not working

@kesha-antonov
Copy link
Author

I added setPlaybackRate method
https://github.com/barmej/react-native-youtube-player/compare/master...kesha-antonov:add_setPlaybackRate?expand=1

Made build yarn build:web

Replaced old version with web/dist/index.html

And I see blank screen

Please help. What am I do wrong?

@kesha-antonov
Copy link
Author

Although if I manually add method in old build - it works
on(){})}),a.default.define("seekTo",function(e){r.seekTo(e).then(function(){})}), a.default.define("setPlaybackRate",function(e){r.setPlaybackRate(e).then(function(){})})},{"youtube-player":"QbF1","react-native-webview-invoke/browser":"vPwy"}]},{},["Focm"]);

@yjose
Copy link
Member

yjose commented Sep 18, 2019

you got it, we still need to use a build system for the web part.
for now, you need to build the web part and copy it manually to the html const https://github.com/barmej/react-native-youtube-player/blob/master/src/mobile/YTWebView.tsx#L64

I will work to automate this process ASAP, and please let me know if you can open a PR to provide a solution for this?

@yjose
Copy link
Member

yjose commented Sep 18, 2019

the idea was to use webpack or parcel and build the web part to a file like the following :

// Html.js
export const Html = ` html here `

so in the YTWebView.tsx we only need to import it.

@kesha-antonov
Copy link
Author

@yjose Agreed
Seems like not a difficult task.
Thing is that when I added that method, made build - yt video stopped working. No errors arised

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

No branches or pull requests

3 participants
@yjose @kesha-antonov and others