Forum Moderators: phranque

Message Too Old, No Replies

Adding video and Window Media Player to page

         

Fortune Hunter

9:06 pm on Mar 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have several Windows Media files that I want to add to a page to play on request. I want to add the Windows Media Player imbedded into the page with a list of the videos under that and when someone click on certain video it starts playing in the media player window. This would be very similar to the way it is done on the news sites.

Does anyone know how to embed this into the page and have each video file just play in that window when you click on it?

Fortune Hunter

Demaestro

9:19 pm on Mar 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hey,

Well there is a simple solution but it doesn't encompass everything you want. It is really simple to have a media player play a file embedded in the web broswer by using the <embed> tag.

Here are some examples.

<EMBED SRC="MyMovie.mov", WIDTH=150, HEIGHT=250 CONTROLS=TRUE>

<EMBED SRC="DoomGame.ids", WIDTH=400, HEIGHT=300 SPEED=SLOW LEVEL=12>

This will not however display the player in the page and then play movies as you click them, as is the described behavior you wanted. But if you are willing to change the user experience then you can set up a page that has links to all the vidoes you want to have. Then you link them to a page that has the embed tag, using query string pass in the name and location of the video file and pass that dynamically to the SRC="" portion of the embed tag.

P.S. this will not always use Windows Media Player, it will use the default player for the browser using the enbed tag. People viewing your sites in linux or mac may not be haappy you are trying to force WMP on them.

Fortune Hunter

8:53 pm on Mar 19, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Damastro:

Thanks, I have it set up the way you describe right now, but the client I am doing this for wants to have more control over the user experience and wants the media player embedded so you can control size of player and that it uses the player defined etc.

Does anyone know how to do what I am trying to accomplish?

Fortune Hunter

walrus

2:03 am on Mar 20, 2006 (gmt 0)

10+ Year Member



Sounds like your already encoding WMA and WMV formats so you might want to start with the code you find at microsoft.

[msdn.microsoft.com ]

Its for WMP6 and WMP7 dated 2000 but if you look around there you may find they have code for the 9 and 10 series as well though i'd expect this will work for all of them.

Demaestro

3:32 am on Mar 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Just want to mention that unless you have the media player on your server, which WILL cost you a license fee, however you still can't force people to use windows media player. Unless they have it on their machine it isn't going to work.

You may want to explain to your client that even though they use windows media that deosn't mean that the rest of the world does. Don't make a mistake and abandon MAC and LINUX users who browse to your site. They may not be able to view the video you want and worse yet you may freeze their system with it. I know how happy I get when that happens to me.

The code I gave you allows to add certain buttons like volume control or pause and play. You will have to look those up though. Just search the internet for the embed tag arguments. And the beauty of it is it will use the media player plugin of users chioce rather then being forced to use something their platform may not support.

Fortune Hunter

8:31 pm on Mar 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Demaestro:

Thanks for your thoughts, but this client is only using my work on an internal intranet site that will be used to get news updates through the company. Everyone is a PC user with Windows Media player already installed.

However I hear what you are saying if the site was going to be a public site. I would never force Windows Player on a live site.

Fortune Hunter

Demaestro

9:10 pm on Mar 20, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Nice,

Yes for a Intranet then you are good to do that. I am still not sure about having the media player embedded server side. I am guessing you will need the software on the server machine itself.

I know that if you are using asp.net then it will be very easy to do as it has built in stuff for Microsoft plugins. I looked at the link provided above and that may work as well.

If you run into any issues post back and I will try to bust them with you.

walrus

8:10 pm on Mar 21, 2006 (gmt 0)

10+ Year Member



Good points Demaestro , never thought about how i was forcing a windows product on the visitor.
I still hav'nt had time to encode for the 3 main players, or for different connection speeds. This is a good reminder to get busy on that.
By the way I think this command(if its called that) is used in case the server doesnt have the software.
I could be way wrong but it loks like it covers WMP ver 6-7. There must be more up to date ones
as this may also be the reason i am having problems with my embeded cartoon feature. Another entry in the long "to do" list.

TYPE="application/x-oleobject"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">

Demaestro

9:33 pm on Mar 21, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Bet my list is longer ;)