Solved

Java script to eambed wmv player in html

Posted on 2011-09-17
9
451 Views
Last Modified: 2012-05-12
Hi,

I want to use javascript to embed wmv player in html

I used JWplayer but it didn't support wmv format

0
Comment
Question by:savsoft
  • 4
  • 3
  • 2
9 Comments
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 125 total points
ID: 36555230
You don't need javascript.  A couple of examples here: http://stackoverflow.com/questions/2538724/how-to-embed-wmv-files-in-my-html-file   And below is one from one of my websites.
<object id="MediaPlayer" width="320" height="290" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

<param name="filename" value="http://www.lisaphenix.com/LisaPhenix.wmv" />
<param name="url" value="http://www.lisaphenix.com/LisaPhenix.wmv" />
<param name="src" value="http://www.lisaphenix.com/LisaPhenix.wmv" />
<param name="Showcontrols" value="True" />
<param name="autoStart" value="True" />

<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="http://www.lisaphenix.com/LisaPhenix.wmv" name="MediaPlayer" width="320" height="290" autostart="1">
</embed>

</object>

Open in new window

0
 

Author Comment

by:savsoft
ID: 36555259
we have to change all filename, url and src address with our file location ?
I have done this but it shows player but didn't play video, webpage is continue loding page...

0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36555276
Yes, you need to change all filename, url and src address to your file location.  That video is currently working on that website.  It works in IE8, Firefox, and Chrome but not in Safari and Opera.
0
 

Author Comment

by:savsoft
ID: 36555282
it doesn't load in firefox 6
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36555369
It does on my computers on Windows XP and Windows 2000.  You do have to have Windows Media Player to play a WMV file.  I don't know what else plays them.
0
 

Author Comment

by:savsoft
ID: 36555378
Following code working fine but didn't shows status or control bar of player so we can replay video
<object id="MediaPlayer" width="320" height="290" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media 

Player components..." type="application/x-oleobject" 

codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

<param name="filename" value="upload/11712-Date-16-09-2011.wmv" />
<param name="url" value="upload/11712-Date-16-09-2011.wmv" />
<param name="src" value="upload/11712-Date-16-09-2011.wmv" />
<param name="Showcontrols" value="True" />
<param name="autoStart" value="True" />
<embed type="application/x-mplayer2" pluginspage="upload/11712-Date-16-09-2011.wmv" src="upload/11712-Date-16-09-2011.wmv" 

name="MediaPlayer" width="320" height="290" autostart="1">
</embed>


</object>

Open in new window

0
 
LVL 82

Expert Comment

by:Dave Baldwin
ID: 36555403
Adjust the width="320" height="290" in two places.  It can cause the controls to be covered.  View your video in Windows Media Player and get the right numbers from it.  On the File menu under properties, you can get the size of your video.  I added 50 to the height to make room for the controls.
0
 
LVL 7

Expert Comment

by:Kishan Zunjare
ID: 36555899
Create Javascript function of you code and provide following in asp.net code behind;

On the page load event
Button1.Attributes.Add("onclick","JS FunctionName()");

Hope this will work.
0
 
LVL 7

Expert Comment

by:Kishan Zunjare
ID: 36555900
Sorry please ignore my post..

Wrong thread...
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now