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.
Related
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
In spotify web-api it is possible to preview track for 30 sec. So, I want to know, is it possible to implement this functionality using spotify android sdk. I was unable to find any Classes or methods related to that and also want to know if this functionality is available in spotify android sdk, then can we test it without spotify Premium account?
OR
Is it possible to use Spotify Web Api in android app?
Any help would be appreciated. Thanks in advance.
The Spotify native SDKs only use a "native" component for playback of full-length songs. The correct, officially-supported way of looking up metadata etc is to use the Web API. The iOS SDK provides a wrapper for this, but the Android SDK doesn't (yet).
Therefore, yes, you should use the Web API in your Android app. Since the Web API allows 30-second previews without authentication, you can do that in your app too.
Since the Android SDK doesn't include wrappers for the Web API at the moment, you'll need to build them yourself. The Spotify Web API is just a standard JSON/REST API - there's nothing special about it - so any Android JSON/REST library should be able to interact with it just fine.
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.
How to do live streaming in google glass through android code, i am using eclipse IDE to develop android apps. I have downloaded GDK and created the project using GDK. I have browsed for live video streaming, i didnt get any blogs related to that(i dont know how to use Mirror API to do live streaming )..Can anyone helped me to go up?
If you're using the GDK, then you can just use the standard android VideoView or MediaPlayer. It's explained pretty well in the Android API Guide. http://developer.android.com/guide/topics/media/mediaplayer.html
You probably want to build and test this in Android first (a phone or emulator). That should be faster since it's easier to interact with the touch screen. Once you have that working you can load it onto your Glass and proceed from there.
As far as I know there isn't a way to do this with the Mirror API. Only with the GDK.
I'm thinking about attending a Google TV hackathon event later this week, and I have no experience with Google TV. It seems that Android is the main platform to build on, but I want to run my existing web app on Google TV. I was wondering how difficult of a job it is, and if it's something that can be done over a weekend. Can anyone provide advice?
Android is a platform to build on for GoogleTV, and it has some advantages, but GoogleTV also has Chrome built in. You can put your web app on Chrome first, and migrate to Android afterwards.
I think the key success factor for any app on Google TV is adherence to the design guidelines. Regardless of which platform you use, you need to design for a 10 foot environment and a mouseless control system. Remember:
TV is a passive environment: People want to watch more and interact less.
People are sitting far away from the screen. Visual processing changes.
TV is more of a group environment.
You are guaranteed a D-pad on a remote control, nothing more.
Very high audio and video quality is expected
Your app is competing with what's on TV.
It really depends on what your webapp does. If it uses Flash, or not. There are lots of things to consider before doing just a "port". On the other hand, if your really interested in that, you might wish to look at this article I wrote: Moving Web Content to Google TV Android Apps If your app isn't already D-pad navigable, you might be interested in the jQuery & Closure extensions as well as our template libraries.
Chrome on Google TV is Chrome 11 w/ security patches. A WebView hasn't really changed in quite a while. If you've got significant CSS3 usage, you'll notice it.
To port existing website to optimized version for Google TV, the key ingredient is use some Javascript library to make your sites D-pad navigable. There are a couple of libraries jQuery and Closure available: https://developers.google.com/tv/web/docs/tools_libraries.
If your site has video content, the easiest way is focus on them and leverage on the Google TV Templates available here: https://developers.google.com/tv/web/docs/gtv-templates.
If videos content you have is relatively static, you may hard code them into your web pages, as done in the Templates above. But if they change often and you'd like to have a backend with an admin page to manage them using e.g. MySQL, read this article to see how it can be done: https://developers.google.com/tv/web/docs/ajax_gtv_templates_tutorial
You can host videos on your own server or play them directly from YouTube. If you need the Javascript to play them from YouTube, let's start a new thread.