[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Java script to eambed wmv player in html

Posted on 2011-09-17
9
Medium Priority
?
505 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 84

Accepted Solution

by:
Dave Baldwin earned 500 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 84

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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

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

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 84

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
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 …
Suggested Courses

872 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