0

I would like play YouTube video on React Native app and enable sound when screen is locked or app in background.

Is it possible on React Native ?

Thank you community !

Stéphane R.
  • 1,386
  • 3
  • 19
  • 37

1 Answers1

0

No , it's not "possible" on react native. There are some modules that allow a background timer or even background tasks in this post you will find manky https://stackoverflow.com/a/50545627/10205629 , but to keep the sound of the webview playing in the background (i assume that you are using a webview to play youtube videos), i don't know if it is a bug or the way the webview is supposed to work, but it will play on the lock screen and on the home screen until the app is killed/removed from ram like this problem

or this one

RegularGuy
  • 3,516
  • 1
  • 12
  • 29
  • Thank you Valda :) I use react-native-youtube, but after try in WebView, the video stop is screen is locked or change app :/ – Stéphane R. Dec 30 '18 at 16:40
  • @StéphaneR. Did you found any solution i am using reactnative webview and trying to achieve background playback? – R.singh Apr 17 '22 at 06:05