I am planning on having a YouTube player in my android app and found two alternatives: IFRAME API or with YouTube Android Player API. So far I don't find any reference for comparing the two approaches.
I am new to both so I don't have a good background to compare both (yet). But so far this is what I know:
IFRAME
Pro: Don't need to get Developer/App Key to access the API.
Pro: Don't need to include YouTubePlayer API's jar (don't increase your APK size)
Con: Unnecessary webview and javascript glue code to hook up
YT Player API:
Pro: Native Java, no need of javascript glue code
Con: Need YouTube app on the device
Con: Need to get Developer/App Key and need to include the API jar to your APK.
Playing with both, I don't know yet any perf/memory usage between the two. I also don't know if we can have more detailed events from the API vs through IFRAME.
I am trying to assess these but would like to hear if any of you have opinions on these.
Thank you
Here you can find a few reason for not using the YouTube Player API.
Overall I'd say: if need to do basic stuff (like using YouTubeBaseActivity/YouTubeStandalonePlayer) you can safely use it. If you need to use the YouTubePlayerFragment a WebView based approach may be a better idea.
Why should you consider not using the official library from YouTube?
If you’re concerned about stability:
The YouTube Android Player API is not the best API ever designed. You are probably going to be fine if you need to use the
YouTubeBaseActivity/YouTubeStandalonePlayer, but you’re going to run into issues with the YouTubePlayerFragment.
The library has some very old bugs, this one is the most significant I have encountered. While developing my app I kept running into it, seeing my app randomly crash for apparently no reason. It made my app unstable and never ready for production.
The bug is still there, as far as I know. A new version of the library should be in the making, but it has yet to be released.
If you don’t want to be tied to Google Play and the YouTube app:
In order to run an app that utilizes the YouTube Android Player API a device needs to have both Google Play and the last version of the YouTube app installed.
This may not be a limitation in most cases, since you’re probably going to distribute your app through Google Play. But I have talked with people that had this problem, maybe you care about it as well.
If you want more control over the player looks and behavior:
The YouTube Android Player API is not open source, therefore the customization you can do goes as far as the API allows to. Maybe you want to change the UI of the player or write some custom behavior specific for your use cases. That is going to be hard to do with the official library.
If you don’t want to register your app in the Google Developers Console
Related
I was reading several tutorials about how to use the Youtube Api. Just to find out after I implemented it. That it was not working when the original Youtube App was not installed on device. In the tutorials I read this was not mentioned. Just in original doc's it says:
The API client library interacts with a service that is distributed as a part of the YouTube app for the Android platform
If that is the case I think it is an exclusion criterion. Cause it forces the user to install another 20mb sized app.
So my question would be if there is another way to play youtube Videos.
One possibility is to use HTML5 player in a web-view. But It may have compatibility issues with older android OS and experience may vary from device to device.
I am creating a game using Libgdx and would like to integrate player, Leaderboard, high score on both iOS and Android devices. Ideally I would use Google Play Game Services but I could be convinced to use other technologies (like Parse).
There are tutorials to use Google Play services for Android devices: (http://theinvader360.blogspot.co.uk/2013/10/google-play-game-services-tutorial-example.html). But as far as I understand, this will not work for iOS devices (according to this:https://developers.google.com/games/services/integration/)
There are also tutorials to do so on iOS devices, using RoboVM: http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=11424 but as far as I understand this will only work for iOS devices.
Since one of libgdx benefit is to write once but to run cross platforms,
my Question is the following:
How do I integrate with Google Play Game Services and run on iOS and Android.
It seems to me that the answer is to use the REST API (https://developers.google.com/games/services/web/api/) since this is technologically agnostic, but that means that I then need to implement quite a few things (login, notifications...)
I cannot imagine I am the first one to be facing this but it seems there are no examples available on the subject.
You don't have to use the REST API for this, even though that would certainly be an option.
The easier way is the use of platform specific code via interfacing.
Everything that is not directly integrated into libGDX won't work via "write once, run everywhere". This also applies to achievements, leaderboards and other things that Google Play Game Services offer. However, you are lucky that GPGS unites these features within one framework for at least Android, iOS and Web.
So what you would do, is adding the platform specific library dependencies to the platform specific projects you have generated. Then implement a generic interface, e. g. AchievementHandler with methods like unlockAchievement(String achievementId).
Then you would implement this interface via AndroidAchievementHandler that makes use of GPGS. The same will work with an IOSAchievementHandler.
In your core code, you will only use AchievementHandler and each platform will use its own implementation of this.
In the latest update to Glass, Google dropped the Hangouts feature. Since the Glass development kit is fairly new does anyone know of any API available to do a video chat using Glass?
Any inputs will be appreciated. At present I am planning to use SIP as done in Android. Can the same be applied to Glass?
This is what they said on the Google + page:
Video calls – We hold ourselves to high standards for the features
that we build, and video calls aren’t living up to these standards.
Explorers have told us so directly, and fewer than 10% of them use
video calls. For this reason, we’ve made the hard decision to remove
video calls from Glass until the experience is better. We don’t know
when that will be, but in the meantime, keep an eye on MyGlass as more
Glassware is built and released – we’re already seeing the developer
community work on other video streaming services. We’ve always said
that feedback from Explorers shapes Glass, and this is no exception.
I think your SIP approach is the way to go for now.
I created a game in Java using Libgdx framework. Now I would like to know if it is possible to use Google Play Game Services in a desktop (java/.jar) game, or is it meant just for mobile devices?
As I am faced with the same question, I do not have a complete answer, but I think the short answer is yes, you can.
But you'll have to use the rest API instead of a nice java API, and some features are not available (such as the real-time online multiplayer support). You can see the reference here:
https://developers.google.com/games/services/web/api/index
As you can see, the major stuff like anchievements, leaderboards, and turn-based multiplayer services should be available (and you can even see there is stuff like joining rooms, but they are marked as "For internal use by the Games SDK only."), so I guess the REST API covers the major needs.
I have yet to test this on a desktop aplication and for sure you'll want some support library to help with the quirks of the HTTP-REST protocol, but I think it is feasible.
EDIT: Since this API is meant for the web, you may still need some kind of initial JavaScript interaction with the user (using google's JavaScript libraries) in order to authenticate the user first, but the rest of the interaction can be done "server-side" (and in any language you want). Read this for more details:
https://developers.google.com/games/services/web/serverlogin
I am trying to make an Android app which will pull uploaded videos from a channel and display them in a list view. Users will be able to watch videos, subscribe to the channel, comment, and like videos.
I have looked at using an Atom feed to get the video info from YouTube (I have a working app), but I came across the Java API for YouTube today, which abstracts all the parsing that's needed, if I implement the REST client code myself.
My question is which is the recommended solution for this? And which will perform better?
for sure " DON'T INVENT THE WHEEL ! "
I build smaller application for android and believe me using YouTube API is much better than anything else.
if you are seeking to play videos inside your Application try to see also Open-Youtube-player !
also you should use the API for other features and for its performance you don't need to add more leakage to your application you need it fast and light.