davidohayon669/react-native-youtube

onStateChange sends firstly stopped on Android

Closed this issue · 5 comments

Hello. On Android, could you explain stopped state at starting player. Is it a bug?

1 stopped <- why on change state sends stopped - changed from what?
2 loading
3 started
4 buffering
5 playing
...

in fact on ios picture is:
1 buffering
2 playing
...

State is changed to stopped whenever the video is interrupted because of anything other than pressing pause button.

State is changed to stopped whenever the video is interrupted because of anything other than pressing pause button.

But this is on first player initialization

Have you tried calling onError event on your youtube player? what does it say ?

onError={e =>{console.log(e); this.setState({ error: e.error })}}

Have you tried calling onError event on your youtube player? what does it say ?

onError={e =>{console.log(e); this.setState({ error: e.error })}}

Nothing. This is usual situation without any errors, and I can play video, about it all is ok. But for some reason that state changes on Android start from stopped. This just confuse me when I want to watch for state changes and react on them.

@Aviemore I guess this is the specific way the native YouTube library works