Reply to topic
Video on our website
cmasteller


Joined: 11 Sep 2006
Posts: 7
Location: Hawaii
Reply with quote
I'd like to put some short video clips on our website. Nothing fancy and don't need a lot of bells and whistles, just looking for what would be the easiest and simplest ways to go.

If someone has some sample code as to what you need to start like Windows Media Player and play a small mpeg clip, that would be perfect.

Thanks
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 534
Location: Harrisburg, PA
Reply with quote
This code is Active X Compliant with Internet Explorer. (Users won't get that dumb prompt). This code will embed the little windows media player right in yoru page.

Be sure to replace YOUR_VIDEO.wmv with your video filename/path. Also, adjust the width and height accordingly.

You will need two javascript files to get them to work. I have posted them for you.

AC_ActiveX.js
AC_RunActiveContent.js

Include them as you see in the first two lines below (adjust for your file location)

Code:

<script src="/Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript">
   AC_AX_RunContent( 'id','MediaPlayer','width','320','height','240','classid','CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95','standby','Loading Windows Media Player components...','type','application/x-oleobject','src','Media/Video/YOUR_VIDEO.wmv','name','MediaPlayer','showcontrols','true','showstatusbar','false','showdisplay','false','autostart','true','filename','Media/Video/YOUR_VIDEO.wmv' ); //end AC code
</script>
<noscript>
<object id="MediaPlayer" width="320" height="240" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
standby="Loading Windows Media Player components..." type="application/x-oleobject">
<param name="FileName" value="Media/Video/YOUR_VIDEO.wmv">
<param name="ShowControls" value="true">
<param name="ShowStatusBar" value="false">
<param name="ShowDisplay" value="false">
<param name="autostart" value="true">
<embed type="application/x-mplayer2" src="Media/Video/YOUR_VIDEO.wmv" name="MediaPlayer"
width="320" height="240" showcontrols="1" showstatusbar="0" showdisplay="0" autostart="0"> </embed>
</object>
</noscript>


If you have a problem getting it to work, let me know Smile
Getting an error
cmasteller


Joined: 11 Sep 2006
Posts: 7
Location: Hawaii
Reply with quote
Jason;

Can you see anything wrong with this code?? Erorr states "Expected ";" on Line 15 char 5.

AC_AX_RunContent('id','MediaPlayer','width','320','height','240','classid','CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95','standby',
'Loading Windows Media Player components...','type','application/x-oleobject','src','/Video/vid.wmv','name','MediaPlayer','showcontrols','true','showstatusbar','false','showdisplay','false','autostart','true','filename','Video/vid.wmv'); //end
this is line 15 AC code
Re: Getting an error
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 534
Location: Harrisburg, PA
Reply with quote
cmasteller wrote:
Jason;

Can you see anything wrong with this code?? Erorr states "Expected ";" on Line 15 char 5.

AC_AX_RunContent('id','MediaPlayer','width','320','height','240','classid','CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95','standby',
'Loading Windows Media Player components...','type','application/x-oleobject','src','/Video/vid.wmv','name','MediaPlayer','showcontrols','true','showstatusbar','false','showdisplay','false','autostart','true','filename','Video/vid.wmv'); //end
this is line 15 AC code


Hmm...I couldn't see a problem so I ran the code and it worked fine (I changed the video location of course)

Make sure you correctly referencing the
AC_ActiveX.js
AC_RunActiveContent.js


The best thing to do to make sure you are referencing them right is to try to download them. So, if you are referencing them relative to the webroot like:

Code:

<script src="/Scripts/AC_ActiveX.js" type="text/javascript"></script>
<script src="/Scripts/AC_RunActiveContent.js" type="text/javascript"></script>


Then try to go to http://www.mysite.com/Scripts/AC_ActiveX.js If it comes up, then your Good, If it says file not found, then there's your problem Try the same for the other one.

As long as you have copied the code exactly as I posted it, it should work. I pulled that right off a production page I run. I only changed the video name.

If you still can't figure it out, you can just embed the video without the Active X fix. But users won't be able to view the video until they click it per Microsofts new Active X restriction in IE.

Embedding Video Without the ActiveX Fix:


Code:

<object id="MediaPlayer" width="192" height="190" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." type="application/x-oleobject">
<param NAME="FileName" value="videofilename.wmv">
<param name="ShowControls" value="true">
<param name="ShowStatusBar" value="false">
<param name="ShowDisplay" value="false">
<param name="autostart" value="false">
<embed type="application/x-mplayer2" src="videofilename.wmv" name="MediaPlayer"
width="192" height="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0">
</embed>
</object>
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 534
Location: Harrisburg, PA
Reply with quote
I will also add you can view HostMySite's support article about HTTP streaming

http://www.hostmysite.com/support/info/streaming/

It's not much different, and does not include the ActiveX Fix.
Ended up using this.
cmasteller


Joined: 11 Sep 2006
Posts: 7
Location: Hawaii
Reply with quote
Jason;

I found this and it appears to work ok.

<script src="./Includes/AC_ActiveX.js" type="text/javascript"></script>
<script src="./Includes/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript">

AC_AX_RunContent( 'id','MediaPlayer1','classid','CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95','codebase','http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701','standby','Loading Microsoft Windows® Media Player components...','type','application/x-oleobject','width','320','height','240','src','video/vid.wmv','autostart','true','pluginspage','http://www.microsoft.com/Windows/MediaPlayer/','showcontrols','true', 'filename','video/vid.wmv','transparentatstart','false' ); //end AC code
</script>
<noscript>
<object>
<param>
<param>
<embed></embed>
</object>
</noscript>

Not sure what all that does but it works so that's all that matters, thanks for your help. By the way, what all would be involved with modifying this to play quicktime .mov files?? I'm thinking I would like to give visitors to our site both options.

Thanks;
Re: Ended up using this.
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 534
Location: Harrisburg, PA
Reply with quote
cmasteller wrote:
By the way, what all would be involved with modifying this to play quicktime .mov files?? I'm thinking I would like to give visitors to our site both options.

Thanks;


See this link for embedding quicktime movies. Keep in mind, that visitors will also need the quicktime plugin.

http://www.apple.com/quicktime/tutorials/embed.html

If you want to use flash, you can also use the Flash 8 video encoder to encode any video into a simple .swf file
Simplepro


Joined: 19 Dec 2006
Posts: 1
Location: Canada
Reply with quote
Thanks for your help with this, upon following your advice I was able to get the embedded player to show in the window, however now it is the case where the sound is playing but the page will not load until the sound cuts off then it will show the Windows Media Player. I m totally lost on this one as i have no idea what is going on, any help will be very much appreciated.


Keep in mind the problem is only in netscape and in IE everything is normal

I m not exactly sure whether this problem lies within the video layout or the audio
any suggestions ?
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 534
Location: Harrisburg, PA
Reply with quote
Can you provide a link to where you have the video so I can take a look at exactly what it's doing?
micke321


Joined: 17 Mar 2008
Posts: 1
Location: Sweeden
Reply with quote
Is it possible to change the code so that the volume is on 100% ?? Not 50 as it is now.
Josh
Forum Regular

Joined: 01 Apr 2004
Posts: 1021
Location: Felton, Delaware
Reply with quote
I also want to throw in that you can do this with Silverlight now. And this guy already has a pretty customizable player (actually he has alot of cool things)...

http://www.jeroenwijering.com/?item=JW_WMV_Player
Video on our website
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic