Playing embedded YouTube Videos - android

I have a WebView app that includes embedded YouTube videos on a page. But when I go to that page, it gives me an error with a whole bunch of text. I have searched the internet for the past week but with no luck. Can somebody please help me?
P.S. I am new to Android, so snippets would REALLY help :)
Here's the error:
vp.events.addOnDOMLoadHandler(function()
{vp.website.createVideoPlayer('mediaPlayer_cff30e24_42e1_4eb6
'http://youtube.com/v/XXXX', 569, 485, false);});
You need Flash Player in order to view this.

well from CommonsWare
You cannot show them embedded except perhaps on devices that have Flash.
here is the link: https://stackoverflow.com/a/2292459/1084764
however you can override the urlLoading on your webviewclient
I suggest you reading the whole post : play youtube video in WebView

Check if the Adobe Flash Player on your phone is indeed working properly.

Related

add inline video player to Flutter Webview

I am creating a browser using flutter_inappwebview. I want to add an inline video player like UC browser has. Can you please help me how do I do that? I couldn't find anything useful by myself.

No seekbar/scrubber when opening mp3(audio) urls with url_launcher or flutter_webview_plugin

When i play an mp3 file through the flutter_webview_plugin or launch it in an webview through url_launch i dont get the option to seek a specific time. It works normally with videos but when it's audio the seekbar/scrubber doesn't appear or actually disappears really fast.
Does anyone have a solution for this?
https://i.stack.imgur.com/eXTdZ.png
And if anyone is still wondering.. The native browser on Android doesn't have better support than this so if you need scrubbing you have to use a player.

android webview youtube iframe like in feedly?

I'm making post activity that has long html that can have many youtube iframes or 0 iframes (uknown count) in it.
The default webview youtube iframe has a lot of bugs. It is not autoscaling on rotation, it has not full screen button, and it continues to play after exit from activity to other and a bit buggy.
But I found in feedly almost same but without these bugs. Here screenshot.
How did they do it?
YouTube provides API to embed videos on android application. Its easy to use and very flexible. Please refer to this tutorial for integration.
A project that ports the IFrame API to Android can be found on PierfrancescoSoffritti/android-youtube-player.
Very easy to integrate and very smooth, but doesn't seem to work on all devices yet.
The player you posted might do it the same way. Just have a look at the source files.

Youtube Player on Android - endless loading

YoutubePlayer shows endless loading when try to play a song with YoutubePlayerAPI in particular with YouTubePlayerSupportFragment for Android. It happens randomly. Sometimes the loading fails with INTERNAL_ERROR. Please see attached images
Strange - because native Youtube app is able to load and play video properly and without any delay.
Please advise what might be the reason of such issues and how to fix them. Thanks in advance
EDIT: I do receive onVideoStarted callback, but still video doesn't play
See this answer and try to do the same YouTubePlayerFragment backstack. I think your problem has same cause as mine. Also check logcat output for errors (it could be obfuscated, and out of application scope, so check 'No filters' in logcat)
I don't know if this really answers the questions, but I was having a similar issue with infinite loading.
Basically I would play a video using a player fragment, exit the video, and then the next video I would try to play would display an infinite loading indicator.
This issue was only happening on certain devices.
Since I was using the latest version of the youtube api, I updated the youtube app on the problematic devices and that seemed to resolve the issue.
I know that "update the youtube app" isn't a great answer, but it did resolve odd issues I was experiencing.
Hope this helps.

Android playing youtube video within webview

WebView and HTML5 <video> (using Surendra and Malenkiy's answer)
I followed whole above thread and many other articles/question online and got the youtube video to work eventually with webview however it opens in a new intent. I want it to play on the same page within specified web view.
Has someone dealt with something like this. I would appreciate your suggestions.
Thanks.

Categories

Resources