views:

85

answers:

2

Hi All,

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

A: 

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/

RobertPitt
Thanks RobertPitt. Your guidence very helpful for me. one onemorething Is possible customize paly controls when play audio/video in thml5.Also we have track event firing when click/touch media controls in the mobile?
sri
Yes event firing is possible with js, Example:: myVideo.addEventListener('ended', function () {alert('video playback finished')} ); There are more commands such as paused, reset and so on! - Look at http://people.opera.com/howcome/2007/video/opacity.html AND http://www.html5video.org/demos/ for lots more info
RobertPitt
Unfortunately, choosing HTML5's video element as your video player comes with some compromises. Firstly, there are still lots of users on the internet using browsers that don't support it at all. Secondly the implementation on each browser is a bit different meaning different codecs will be needed for different browsers.
free-dom
Witch is why a fallback would be necessary, If the html5 player fails then you replace the html with a windows media or your own simple swf version.
RobertPitt
+2  A: 

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.

bobince
Thanks bobince. it is very clear.
sri