Main problem is with Android (both emulator and device). Using WebView to show and play a video (YouTube/Vimeo) audio works fine but with video got blank or black screen.
Yes, I found a few links that may help with this:
Android issue with videos embedded on WebView playing only audio no video
Android
1) Clone the repo
git clone https://github.com/iecoding/NativeScript-Android-Issue-with-Videos.git
2) Change directory and run Install npm packages
cd NativeScript-Android-Issue-with-Videos
install npm
3) Run the app on android
tns run android
No additional code (i think)
This issue is also on {N} Discourse Community https://discourse.nativescript.org/t/android-issue-with-videos-playing-only-audio-no-video-using-webview/3153
Any help will make me alive. Thanks
_ _
Israel Estrada
@iecoding this is a limitation for native Android developers as well and the reason is the way YouTube API is working. In fact, your snippet runs the YouTube video perfectly on my Nexus 5x (with Android Oreo) however this is not a valid case for the emulator and a number of other devices.
AS recommended by YouTube and Google the best approach would be to use the YouTube APi (create a NativeScript plugin). Another approach would be to use nativescript-videoplayer along with nativescript-youtube-parser plugin.
@NickIliev thank you so much!
I was trying with my old huawei phone that runs android 4.3 and of course did not work.
I borrowed a coworker phone that have Android 6.0 and works like a charm!
Beginner mistake.
@NickIliev i did a nativescript-youtubeplayer a couple months ago
@iecoding How did you fix this? I am facing the same issue on android emulators, only audio plays and no video.
I have a TV that is android 4.3 . There is no upgrade. So one have to fix issues like this.
Btw, I have downloaded the youtube api player demo but it cannot run yet.
Immediately I have to change the target version. Have to take more time to try it.
@NickIliev but nativescript-videoplayer does not support adaptive streaming does it?
We have a different issue. Video from Vimeo playing normally, but no sound :D Any ideas?
How to make video full screen in webview?
Most helpful comment
@iecoding How did you fix this? I am facing the same issue on android emulators, only audio plays and no video.