android-youtube-api

Upgrade to the latest version of the Android YouTube API

橙三吉。 提交于 2019-12-18 09:44:28
问题 The Android App does using YoutubeBaseActivity does not play video. The Log is same with the title. "Cannot load modern controls UI. Upgrade to the latest version of the Android YouTube API." I think it is because I have updated the Youtube App. Videos have played with no problem after I deleted the Youtube App Updates. But this is not the solution. Many people installed this app from Google Play Market and are using it. Is it a problem of Google not supporting newest Android Youtube API?

retrive only mobile-supported video from YouTube API

只谈情不闲聊 提交于 2019-12-18 09:26:40
问题 I'm using the YouTube API to retrieve videos for and Android client. The program works well but sometimes I get an error like "this video is not allowed to run on smartphones". So, there is a way to filter that videos? I read this doc but did not find a solution. 回答1: There are two concepts embeddable and syndicated. iOS devices use iframe so they basically embed. Android devices that use player API can check syndicated. When you do a search->list, you can set videoEmbeddable and

how to set to play only HD Videos in YouTube Android Player API

核能气质少年 提交于 2019-12-18 07:04:51
问题 How to make YouTube Android Player API play only HD Videos Link @Override public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player, boolean wasRestored) { if (!wasRestored) { Log.v("Mobile Url", "" + mobile_url); player.loadVideo(mobile_url); player.setFullscreen(true); player.setShowFullscreenButton(false); player.loadVideo("N1nFoVI3xJM"); } } Here I can set the loadVideo , setFullscreen , setShowFullscreenButton I need to load only HD Videos . Is that

Android : youtube player has been released

别来无恙 提交于 2019-12-18 03:15:28
问题 I'm getting this error Fatal Exception: java.lang.IllegalStateException This YouTubePlayer has been released , but release() wasn't called explicitly.Here is the piece of code where crash occurs : if(youtubePlayer != null){ time = youtubePlayer.getCurrentTimeMillis();//exception may occur } is it possible to check that youtubePlayer was released ? Any callback ? Thanks. 回答1: Most of the code in the Youtube SDK is obfuscated which makes it really hard to debug. And the fact that there isn't

How to play a video with the YouTube API using YouTubePlayerFragment?

落花浮王杯 提交于 2019-12-18 02:48:18
问题 I'm trying to play video in my Fragment. However, I cannot get it to work. If I'm extending 'YoutubeFailureRecovery' I get: 09-06 21:56:40.472: E/AndroidRuntime(4946): Caused by: java.lang.IllegalStateException: A YouTubePlayerView can only be created with an Activity which extends YouTubeBaseActivity as its context. This is my .xml: <com.google.android.youtube.player.YouTubePlayerView android:id="@+id/player" android:layout_width="match_parent" android:layout_height="wrap_content"/> And this

Error inflating class com.google.android.youtube.player.YouTubePlayerView In List Adapter

喜你入骨 提交于 2019-12-17 13:51:06
问题 I am trying to inflate <com.google.android.youtube.player.YouTubePlayerView android:id="@+id/youtubeplayerview" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" /> in List adapter so that I can play video in the listview it self but I am getting error Error inflating class com.google.android.youtube.player.YouTubePlayerView while if I am using <com.google.android.youtube.player.YouTubeThumbnailView android:id="@+id/youtubeplayerview" android

How to get the title of YouTube video through the YouTube API

强颜欢笑 提交于 2019-12-14 03:25:37
问题 I've the layout for a YouTube video. I would like to set the video's Thumbnail and Title. (I succeeded to set the thumbnail but not the title) <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:weightSum="1.0"> <com.google.android.youtube.player.YouTubeThumbnailView android:layout_width="match_parent" android:layout

How to Handle YouTube Fragment OnSaveInstanceState

心已入冬 提交于 2019-12-14 03:05:54
问题 Issue The YouTube documentation does not clearly outline where to call seekToMillis() in the YouTube lifecycle of their API guide or documentation for Android. In order to make sure the YouTube player picks up from where it left of when the screen is rotated seekToMillis(...) is required. However, this method does not work as expected being called directly before or after loadVideo(...) or play() . Expected Call seekToMillis(...) to start video at specific point in milliseconds. 回答1: Solution

Youtubeapi illegalstateexception player has been released

落花浮王杯 提交于 2019-12-13 19:06:16
问题 I am using YoutubeAPI on my app but I am getting illegalstateexception of the following code.It says player has been released . How do I overcome this problem @Override protected void onResume() { if (video_player != null ){ video_player.seekToMillis(pausedDuration); } // <-- this will cause re-buffer. super.onResume(); } edit 1 initialization of player @Override public void onInitializationSuccess(YouTubePlayer.Provider provider, YouTubePlayer player,boolean wasRestored) { if (!wasRestored)

Youtube search fail with GoogleJsonResponseException: 403 Forbidden

孤街醉人 提交于 2019-12-13 15:24:03
问题 This seems like a basic procedure but I don't know what's going wrong. Error in logcat output: com.google.api.client.googleapis.json.GoogleJsonResponseException: 403 Forbidden { "code" : 403, 02-26 "errors" : [ { "domain" : "usageLimits", "message" : "Access Not Configured", "reason" : "accessNotConfigured" } "message" : "Access Not Configured" I configured in the code.google.com API console the YouTube data API and got a simple access API key for my Android app. The code is below; the same