Solved

Java script to eambed wmv player in html

Posted on 2011-09-17
9
465 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 83

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 83

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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

Author Comment

by:savsoft
ID: 36555282
it doesn't load in firefox 6
0
 
LVL 83

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 83

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Link a VBS to an HTA 6 38
How to get this page layout correct 13 31
Joomla 2.5 shopping cart 7 24
Can't get container centered 4 16
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…

825 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