Solved

Java script to eambed wmv player in html

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

Author Comment

by:savsoft
ID: 36555282
it doesn't load in firefox 6
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

910 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

22 Experts available now in Live!

Get 1:1 Help Now