Does the YouTube JS API work in non-Flash environments? - javascript

At the present time (Nov 2013), the docs for YouTube's JS API state:
Requirements
The end user must have Flash Player 10.1 or higher installed to view
everything correctly. Because of this requirement, we suggest using
SWFObject to embed the SWF and detect the user's Flash Player version.
See https://developers.google.com/youtube/js_api_reference.
Should I use the JS API or just avoid it in favor of native browser methods?

YouTube offers an HTML5 player but you can't force it at this time.
Only viewers themselves can indicate they would like the HTML5 player instead of the Flash player. I think the APIs are set up to work with both the Flash variant and the HTML5 variant.
So, yes, YouTube works in non-Flash environments, but only under certain conditions.

Related

Can SoundManager2 use Flash as a backup for the same sounds if HTML5 is not available?

SoundManager2 seems awesome, but the main reason I'm looking to use something other than solo HTML5 is compatibility. What I would like SM2 to do is use HTML5 audio if available, and fall-back to Flash otherwise (for the same sounds). It seems like it should be able to do it, but I haven't yet figured out how.
For example, I'd create a sound called "moo" and link to the sound file. SM2 would then see if it can play that sound using HTML5. If not, it would load Flash to play the sound instead. From the perspective of my app, I should only request the playback of "moo" and SM2 would take care of making sure it plays.
I suspect it may be necessary for me to generate the audio clips in more than one format (possibly .ogg for HTML5 and MP3 for Flash?). I can do that if needed.
Alternatively, I could have my own JavaScript code to detect if the browser will be able to play sounds using HTML5 and pass a different configuration to SM2, but I'd prefer a cleaner way.
Thanks in advance :-)
yes, SM2 uses a Flash fallback:
Using HTML5 and Flash, SoundManager 2 provides reliable cross-platform
audio under a single JavaScript API
both SM2 and jPlayer will give you want you want, it just boils down to API preference.
generally, i'd choose jPlayer if cross-browser compatibility is crucial to you - SM2 is comparatively new to the world of HTML5 audio.. choose SM2 if you're happy using Flash and want more advanced features like access to the raw samples of the audio (to build a level meter or visualisation).
You should look into jPlayer.
It's what we use for cross-platform support. The documentation can be a little sparse at times, but it's rather useful.

JavaScript and microphone audio stream

Since HTML5 isn't ready yet, and getUserMedia doesn't work in browsers i have tested, I am asking that is there any "wrappers" so I could grap audio stream from microphone and send it to server with Javascript. Similar wrapper has been made with web cameras: (google for a "jquery-webcam-plugin". Two link restriction), but I haven't found any similar things for microphone audio streaming.
Audio can be in any commonly known format.
Flash is not my daily basis, flash tips might not help.
Since Google gears has been deprecated, I think it is not wise to use AudioApi. This is not a good news either, so I am guessing that only choices are Java and Flash.
I will appreciate every hint and tip I get.
I'm not sure what you mean by "Flash is not my daily basis". Your other option is Java, but that's less user-friendly. If you're going to require a plug-in (and you'll have to until getUserMedia() is implemented), you might as well make it Flash.
Here is a project that wraps a simple Flash app with a Javascript API that streams audio via an HTTP post to a web-server of your choice:
https://code.google.com/p/wami-recorder/
It's not ideal, but it works and does not require a clunky Flash Media Server.

Create and use youtube embed object w/ javascript api on mobile web browsers

I'm trying to build a simple webapp that leverages the embedded youtube javascript api (http://code.google.com/apis/youtube/js_api_reference.html). It works well on my Chrome, Safari, etc... but it fails to work on the Android and iOS web browsers because of its SWF object dependency. I'm hoping for mobile compatibility.
Am I doing something wrong, or is there a is there a way to get around this?
(My requirements are as one would expect: I have a youtube video id that I'd like to use to create an embedded youtube video object w/ javascript api access.)
Thanks.
I'm not well versed with Android, but I know that iOS devices will recognize and convert a standard <object><embed></embed></object> Youtube embed code to a compatible player, as long as the object wasn't created with Javascript, such as with swfobject.
However, I'm not sure if the javascript controls will work in the mobile player. I've not tested this.
Unfortunately, there is not currently a way to interact with the html5 (<iframe>) embedded player. I'm not sure what the status is, but controlling the <iframe> player with javascript introduces some interesting challenges.

Is HTML5 developed and documented enough?

I own a site which offers a Flash based music shopping cart which steams music using RTMP. Mobile devices are getting more and more popular and the exclusion of Flash means they don't support my Flash application. I was wondering if it's possible to create the same kind of Flash widget I have on my site in HTML5 or maybe even JavaScript alone? Is HTML5 developed enough for this kind of system? If possible, would users be able to embed an HTML5 version of our players? Can you stream music via RTMP using anything but Flash?
Thanks for your help
To answer your question YES HTML5 is documented and developed enough but the question that you should be asking is "Is HTML5 supported enough?"
HTML5 is markup AND JavaScript and its not supported in every browser. This is mitigated though by many great JavaScript libraries that will gracefully degrade depending on what browser/device is viewing it.
If you just want to learn more and make a decision for yourself I would suggest reading Dive into HTML5 to figure out what HTML5 is all about and what it offers.
No, you cannot stream music using RTMP in HTML5. However, you can offer music in mp3 and ogg formats. (You'll need to offer both to cover all browsers)
After looking at your site, I would recommend you continue to use flash because HTML5 does not support streaming audio, only audio available to download. While the shopping cart and everything else can mostly be done in HTML5, your users will still need Flash unless you want to allow users to download the music easily.

Get default media player using Javascript?

Whether is it possible to get default media player using Javascript, customize play controls and control play functions (Play, Stop, Seek, Pause..etc)
Thanks in advance,
Sri
No. The operating system's idea of a default media player (if it even has such a concept) is not accessible to the web browser, and most media players can't be controlled from a web page's JavaScript code anyway.
(With good reason: exposing a highly complex program like a media player to the Internet is a dangerous proposition. If just one bit of code in the handling of any format the player can read has an exploitable bug, then now every web page you visit could embed a media player and use the security hole to take over your machine. Indeed, this has happened many times in the past with Windows Media Player, QuickTime and RealPlayer, even though they were designed to be Internet-facing.)
You can embed a particular media player that was designed for it, and fall back to another media player if not available. So you could try to embed WMP, then fall back to QT if that failed, and fall back to Real if that failed.
But really, the days when it made any sense to do this are long gone. Today's it's all about the HTML5 and Flash video. The embedding of media players is dead, and good riddance to it.
I'm not sure what you mean but if you're talking about Windows Media player specifically I'm sure their embed version will have some skin Params, etc., you can play with.
Although I would advise you to take a look at HTML5 Media Player (http://html5demos.com/video) which is customizable and controllable via JavaScript
Here's a certified library that would be helpful in pushing html5 to the limit when it comes to video embedding: http://www.kaltura.org/project/

Categories