Open kesha-antonov opened 4 years ago
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?
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"]);
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?
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.
@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
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-L65I'm making custom component based on your lib and
setPlaybackRate
is not working