LonelyCpp / react-native-youtube-iframe

A wrapper of the Youtube-iframe API built for react native.
https://lonelycpp.github.io/react-native-youtube-iframe/
MIT License
594 stars 147 forks source link

Volume prop not affecting volume at all on YoutubePlayer #305

Open ChristopherGabba opened 10 months ago

ChristopherGabba commented 10 months ago

Using YoutubePlayer in very typical way, nothing fancy, just trying to play video on main screen.

                    <YoutubePlayer
                        ref={youtubeRef}
                        mute={true}
                        volume={50}
                        height={250}
                        width={width}
                        forceAndroidAutoplay
                        allowWebViewZoom
                        initialPlayerParams={{
                            controls: false,
                            preventFullScreen: true
                        }}
                        play={true}
                        onReady={() => { console.log('video Ready') }}
                        videoId={'sSsTR8qqDl4'} />Ï

The mute function works fine, but no matter if I set the volume at 0, 0.1, or 100 the volume is the exact same with no change. If I set the volume to 0 (but don't turn on mute at all), the symbol on the YouTube controls even shows muted but the volume is still maximum.

I actually tried playing this video in a web view using source={{html: xxx}} and used a div and video html component and injecting javascript to change the volume and it did not work there either. I suspect this issue may be related to the react-native-webview because it was similar there as well, so I submitted an issue there too: https://github.com/react-native-webview/react-native-webview/issues/3127.

To Reproduce Paste the YouTube player code above in app with the same params.

Expected behavior The volume should change with the volume prop changing.

Smartphone (please complete the following information):

uoon-dev commented 2 months ago

same here