?
Solved

Streaming wmv files

Posted on 2006-05-03
17
Medium Priority
?
5,165 Views
Last Modified: 2008-01-09
Hi,

I'm using this code to stream a movie in a web page
-----------------------------------------------------------------
<OBJECT id=player789 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6></OBJECT>
      <script>
      player789.uiMode="none"
      player789.settings.autoStart=true
      player789.settings.playCount=1
      player789.settings.volume=100
      player789.stretchToFit=true
      player789.windowlessVideo=false
      player789.URL="http://mydomain.com/clips/mj_show.wmv"
      </script>
------------------------------------------------------------------
As you see the uiMode is set to "none" and windows media player
doesn't shows its controls and status bar.
(I don't want windows media player to shows up its controls)

Now, when users access this page, they face a black screen the first several
seconds while wmv is buffering. This several seconds may be longer for users
on a dialup connection.
Is there any way to show a message like "please wait" or "media is loading"
and make it disapear as soon as wmv starts playing?
If the above script is not able to be used for this purpose,
any other script with this ability is appreciated.

thank you for any kind of advice and help.
0
Comment
Question by:MnInShdw
  • 6
  • 5
  • 4
  • +1
17 Comments
 
LVL 20

Expert Comment

by:Gawai
ID: 16595745
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16596647
thank you for trying to help. I went through the above
links and unfortunately I wasn't able to find the answer
to my question.
I don't want to show the statusbar and the controls.
----------------------------------------------------------------
<PARAM NAME="ShowStatusBar"   VALUE="false">
<PARAM NAME="ShowDisplay"   VALUE="false">
----------------------------------------------------------------
How can I show a message like "please wait" or "media is loading"


I appreciate any kind of help
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16596685
Hi,
if there is a property player789.settings.AnimationAtStart or player789.AnimationAtStart you can set it to true.

Similar to:
<OBJECT ID="MediaPlayer" width="182" height="160" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
<PARAM name="autoStart" value="True">
<PARAM name="uiMode" value="none">
<PARAM name="AnimationAtStart" value="True">
<PARAM name="URL" value="Media/value.mpg">
</OBJECT>
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16597161
Hi WelkinMaze

I tried your sollusion and wasn't able to show the animation.
I've been told windows media player 9+ doesn't support this
Parameter.

thank you for your input
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16597416
If it really does not work, another way is just to place a message near the video window that says "You may have to wait some time for loading..." or something similar.
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16598181
Is it possible to remove this message when windows media player start playing the video?
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16598246
maybe with some javascript coding you can try to replace it with an empty string
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16601478
What is the trigger for the javascript function?
How can I understand buffering is finished and
playing has been started to fire the trigger and
make its style.visibility to hidden or it's innerHTML to null?
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16604057
Hi WelkinMaze
I appreciate all your help.
The bove links are a part of support of clipstream, a special software
for encoding video files and embedding them in web pages (annual $750)
and is only usable with cvs files (encoded files with this software)
0
 
LVL 11

Expert Comment

by:WelkinMaze
ID: 16604092
I think that you can use something from the second link (for example setTimeout). The only problem is that you have to specify the time in advance.
0
 
LVL 11

Expert Comment

by:JohnModig
ID: 16624529
Hi MnInShdw.
For streaming video, use Windows Media (.wmv). The browser support is wide and your files will be much smaller than if using flash. Specially if you have long movies, streaming is a must. And wmv does a good job doing it. The tricky part is to make it work other browsers than IE. But there are solutions! When you embed the videoplayer on your website, in order to make it work in Netscape or Firefox you cannot use class for windows media player higher than 6.4. Also, make a metafile (.wvx). Reasons for this: Video becomes streamable, you are able to make playlists, and also it hides the url to the actual videofile, making the users unable to find and download the video. Ok? Ready for some code? This one is tested working on IE 5.5, NS 7, FF 1.04 and Opera 8:
--------------------------
1. Compress your video to streaming wmv:
--------------------------
Again, since streaming is really important here, this part is important. There are many tools and programs out there that compresses video to wmv. I strongly recommend using discreet Cleaner XL, available in a free 30-day trial here: http://www4.discreet.com/cleanerxl/cleaner.php?id=124 This program is easy to use and will do all the necessary streaming settings for you (important!).

Save your videofile as myvideo.wmv

--------------------------
2. Put this HTML in player page:
--------------------------
<!-- comments by John Modig -->
<!-- embeded windows media player, tested in IE 6.0, NS 7.0, FF 1.04 and Opera 8.0 -->
<!-- CLSID:22D6f31... = Windows Media Player 6.4 - higher versions not compatible with other browsers than IE -->
<!-- it is important to use BOTH object and embed tag for multi-browser support -->
<!-- object tag = IE, embed tag = NS, Opera, FF -->
<object id="MediaPlayer" width="400" height="300" classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player..."
type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112">
<!-- param tag = only for object tag, meaning only for IE -->
<param name="autoStart" value="True">
<param name="filename" value="http://www.mysite.com/myvideo.wvx">
<param name="ShowControls" value="True">
<param name="AutoRewind" value="True">
<param name="ShowStatusBar" value="True">
<!-- src tag have to be FULL url to work with NS -->
<!-- video/x-ms-wvx has better support (note! only for wvx files!) in FF and NS than application/x-mplayer2 -->
<embed type="video/x-ms-wvx" src="http://www.mysite.com/myvideo.wvx" name="MediaPlayer" width="400" height="300" autostart="true">
</embed>
</object>

--------------------------
3. Create the metafile, open notepad and type this:
--------------------------

<asx version = "3.0">
<!-- comments by John Modig -->
<!-- tags for the playlist -->
<title>My playlist title</title>
<author>My name</author>
<abstract>© Copyright My Name</abstract>
<!-- clip no 1 -->
<entry>
<title>My clip title</title>
<author>My name</author>
<abstract>© Copyright My Name</abstract>
<!-- path to your video file, does not have to be full url, it is still compatible with NS 7.0, FF 1.04 and Opera 8 -->
<ref href="myvideo.wmv" />
</entry>
</asx>

Save the textfile as myvideo.wvx and put in the same directory as the videofile.

More info on metafiles here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmplay10/mmp_sdk/windowsmediametafileguide.asp

--------------------------
That should do it! Good luck and let me know how it went.

Regards,

John
0
 
LVL 11

Accepted Solution

by:
JohnModig earned 1500 total points
ID: 16624558
...and as a sidenote to the javascript issue. There is a way to determine wether the mediaplayer is playing or not by using:

document.mediaPlayer.GetPlayState()

However, this does NOT inklude buffering. The GetPlayState() method simply returns the status of the media. It is 0 when the media is in stop position, 1 when it is in pause position, and 2 if the media is currently playing. So, no way to get the buffering status there, Im afraid. Also - hard to find something that could trigger this function.

John
0
 
LVL 11

Expert Comment

by:JohnModig
ID: 16624589
...but if you think you REALLY need that loading message, a workaround would be to convert your movies into Flash:
http://www.download.com/Riva-FLV-Encoder/3000-2140_4-10381392.html?tag=lst-0-1

Then use a customizable player like Wimpyplayer to show the movies on your website, just the way you want it - with preloading message and all:
http://www.wimpyplayer.com

Please note - this method will increase the file size and is not suitable for long movies. However, for short ones it is fine and very flexible.

Regards,
John
0
 
LVL 1

Author Comment

by:MnInShdw
ID: 16630171
Million thanks
0
 
LVL 11

Expert Comment

by:JohnModig
ID: 16630583
No problems, glad to help out :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

807 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