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.
Related
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.
I want to develop a scenario:
when i click on listview item youtube video should start playing.
Listview content is fetched from JSON. JSON object has title, description and youtube url. This youtube url should initiate the youtube player.
I tried few tutorials from the internet but the problem is: when youtube video is playing in portrait mode, blank white screen is displayed below the video view. I want to display the next videos thumbnails as listview there. Can any one suggest me how to do this?...
Create an explicit intent and set the url as an extra for the intent.
You can find more information about intents here: https://developer.android.com/guide/components/intents-filters.html
You can also checkout this link for intents specific to the Youtube app https://developers.google.com/youtube/android/player/reference/com/google/android/youtube/player/YouTubeIntents
In the future, do a google search before posting questions on stackoverflow. You need to show that you have done your own research before asking such vague questions on here.
Possible duplicate (please don't vote my answer):
Embed Youtube video inside an Android app
and
How to play YouTube video in my Android application?
Some other resources you can use: https://developers.google.com/youtube/android/player/sample-applications
Because I do not fully understand the context of your app, you will have to decide which type of player is best for you.
I try to play a youtube video in a WebView. So far the video loads but the play button still doesnt work. Embedding the video wont work for me (because many videos simply cannot be played that way because of licencing problems), neither would opening a browser/youtube/whatever. So basically my only other option would be using the Youtube Android API which I find a bit much for a simple task like that.
I checked most answers here but nothing really worked.
Here is the problem in one pic. Clicking on the play button just opens this slider with some like-dislike features, but the video never gets played.
My code is:
w = (WebView)findViewById(R.id.webView1);
w.setWebViewClient(new WebViewClient());
w.setWebChromeClient(new WebChromeClient() {});
w.getSettings().setJavaScriptEnabled(true);
w.loadUrl(url);
Would appreciate any input regarding this
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.
I would like to embed a videoview in a webview. I would like to play an mp4 video on that video view. Please guide me with some pointers so that i can implement this.
Update
I have only html4 browser
there was already a question with answer on it.
HTML5 <video> element on Android
I think it's what you're looking for...
EDIT:
I dunno why you have only HTML4 but look at this then:
http://www.robinlionheart.com/stds/html4/objvideo
As far as I know you need the quicktime settings for mp4...