I want to integrate video player for you tube specially. I found youtube android player tools but i did not find implementation.
And I have implemented android-youtube-player. but it is not working.
If anyone has integrated then need help.
I want to integrate video player for you tube specially. I found youtube android player tools but i did not find implementation.
And I have implemented android-youtube-player. but it is not working.
If anyone has integrated then need help.
The YouTube Andoid Player presentation was made at Google I/O 2012 and the Android Player API is not yet publicly available (As of 21st Nov 2012). That presentation is the only public information I'm aware of.
(Update: It's now been publicly announced, and released as an experimental API: http://apiblog.youtube.com/2012/12/no-webview-required-with-native-youtube.html )
The android-youtube-player library is unofficial. I suggest you read the YouTube API Terms of Service:
https://developers.google.com/youtube/terms
In particular, you may not use any player other than the official YouTube players.
I have heard reports of the iframe API working by embedding it in an embedded web view - but I can't verify those reports personally, or how to deal with issues such as cross domain messaging and cross-language bindings between java and the dom javascript bindings.
The easiest way to load a YouTube video from an android app is to call for the OS to load the YouTube video using intents.
Given there is an Android library in development at YouTube (from your link), I would suggest using the quickest and easiest method available for now, and potentially using that API in a later update.
There's more discussion on calling to start the video in the YouTube app here: Android YouTube app Play Video Intent
Intent i = new Intent ( Intent . ACTION_VIEW , Uri . parse ( "vnd.youtube:" + videoID ));
List < ResolveInfo > list = getPackageManager (). queryIntentActivities ( i , PackageManager . MATCH_DEFAULT_ONLY );
if ( list . size () == 0 ) {
//write you own activity to display the video, if default youtube video display class is not available or else use the default class it self
}
System.out.println("Intent Actin :"+i.getAction());
startActivity ( i );
Right now, the only feasible method I have had success with is embedding the content into a webview using html5. Unfortunately this limits the API level to 13 or so. You don't go outside of the app, however the play and pause controls are within the webview, and I can't figure out how determine when a video completes.
The concept of making user 'leave' your app to use the YouTube player itself via intents is laughable. If you are doing something more than just playing a video (like we need an app that only plays one video) then you need them to come back to make the app worthwhile and novel. Using the native player with an rstp stream is an option, however usually the video resolution is some small weird 172x90 or so, probably not acceptable.
I have implemented with the webview, but am holding off releasing the app waiting for the Android player API that Tim mentions. As for release date, I only have this: YouTubePlayerAPI Schedule for Distribution?
Seems unseemly to highlight this great stuff that we need for Android, in July, and then nothing for months, especially when there are much more straightforward, robust methods in IOS. I spent time and resources developing an app with the expectation of using this api in a reasonable future, and feel let down considering the lack of followup and overall poor communication regarding this api.