I (actually my app team) embed my YouTube videos on the app.
The videos are played well in the app, but video views aren't counted.
We use YouTube IFrame API and android webview.
We checked the views are counted in PC and mobile, so we think IFrame API is okay.
We think the view-count problem is from Android webview.
Doesn't Android webview count YouTube video views originally?
I don't set autoplay for video watching.
Thank you.
You need to disable autoplay and let users play the video through the native play button since: "YouTube only counts playbacks that are initiated through the native play button." REF
Related
Impossible to autoplay youtube videos in an Android webview by using youtube iframe API. Does someone knows if that is possible?
As already mentioned in Mobile Considerations, functions and parameters such as autoplay, playVideo(), loadVideoById() won't work in all mobile environments due to the restrictions wherein HTML5 <video> element only allows playback to take place if it's initiated by a user interaction.
You may, however, try the given suggestions in the following SO posts and might work for you:
Youtube Api android autostart
You can use loadVideo() method which loads and plays the specified video. And, there is also the cueVideo() method, which adds the video to the playlist, but does not automatically start playing the video.
Android webview html5 video autoplay not working on android 4.0.3
You can usually work around it by triggering the play() on another event (eg the onloaded event).
Hope that helps!
I want to play All types videos in single webview in android programmatically.
I already tried for yahoo/youtube/vimeo videos play in webview in android using iframe.
But, its not working properly.
only working for youtube videos only playing in webview using iframe in android.
next one, vimeo video is playing in webview, but, its not playing full video, just loading video in webview,
that's it. its not fully playing.Its automatically paused.
when I click play button, its again paused..
next one, yahoo video is not playing fully..
I refereed those link also.
how to play vimeo video using iframe in webview?
https://github.com/droid28/VimeoVideo
Auto playing vimeo videos in Android webview
also I put some questions related this.
https://stackoverflow.com/questions/25402410/play-vimeo-videos-in-webview-in-android-programmatically
https://stackoverflow.com/questions/25402052/play-yahoo-videos-in-webview-in-android-programmatically
can anyone help me to come out from this problem.
Thanks
Advance
I'm looking for a solution about YouTube in Android.
When my WebView in app connects an webpage, some pages may have embedded YouTube clip.
When I press the RED play button in the center of embedded clip, it plays well. Yes I set enabled JavaScript , plugins, hardware acceleration etc. But it ONLY plays in the WebView internal media player.
I've tried with several libraries such like YouTube API that provided by Google, but It just provides Views and interfaces, and cannot convert a YouTube clip in WebView to a YouTubeView (If you know how to convert, let me know).
All I want is simple. Hit a red play button in embedded YouTube, then my app launches YouTube App (or stock media player) so play the YouTube clip.
iPhone can do this very simply with the stock player, but I can't understand why Android can't do so.
Please check whether "YouTube" application is install on your device? If yes then just update it.And most of the time you tube application not working properly on emulator..
I am using Youtube player to play youtube videos. I am getting ads continuesly,which I need to skip after 5sec. I just wants to block these while playing the youtube videos.
Did I have any chance to do this?
From Embed YouTube Video with No Ads, there's a link to Ads on Embedded Videos:
Enable or disable ads on embedded videos
You will automatically be opted into showing ads on embedded videos if
you've associated your YouTube and AdSense accounts and have enabled
your videos for embedding.
If you don't want to show overlay ads on your embedded videos, you can
opt your videos out of showing overlay ads, though this will also
disable overlay ads on your videos on YouTube.com. You may also
disable your videos for embedding.
see also: How can I disable the advertisements shown before Youtube videos?
edited for ideas on using code, see: Setting Cookies in browser for video autoplay and then try to use the code at How to Disable All YouTube Ads with a Simple Browser Hack – Guide
First some details to help explain:
If you load a Vimeo link such as the following:
http://player.vimeo.com/video/40234826, or use their iframe embed code,
into a WebView, one of two things will happen.
If the device has the Adobe Flash Player app/plugin installed, it will display Vimeo's embedded player. Tapping play, plays the video inline as an embed.
If the device does not have the flash plugin, it will display an image with a play button. Tapping play, opens the Video in a system VideoView. (Because the button links to an mp4 file.)
Since Vimeo's embedded play can be a bit buggy on the vast variety of devices available, I have found that option 2, playing the Vimeo video in an Android media player is a much better experience.
Now the question is, how can I convince the WebView not to use Flash?
I have tried webview.getSettings().setPluginsEnabled(false); but it still loads the flash embed version. How can I trick Vimeo's player into thinking the device does not have flash installed?
Thanks
Update
After further investigating, it seems that setPluginState(PluginState.OFF) works pre honeycomb, but this doesn't work on Honeycomb and ICS.