PDA

Click to See Complete Forum and Search --> : Please help with loading a wmv file



Juniper555
09-26-2002, 11:09 AM
Please could someone tell me what I am doing wrong...

This may be a little complicated to explain, but I hope you will understand what I am trying to say and do!!!

There is a section in the Flash 6 movie that allows loading of sections of a showreel... video clips that are .wmv files.

Within my Flash 6 movie, I call for an external video clip (which is part of a showreel) using the following:


on (release) {getURL("http://?.??.???.??:??/NAME.wmv", "_self");
}


Looking at it on the web, it calls for the video clip and pops it up into a Windows Media Player window... but behind the wmv file loading, my Flash movie goes back to the start of the movie and does not stay on the showreel page.

So if you want to look at another section of the showreel, you would have to navigate back there again, which is really irritating.

How do I get the Flash movie to stay where it is without going back to the beginning again?

Many thanks

Frets
09-27-2002, 12:59 AM
It reads like the page is being refreshed to fetch the file.

as your calling the file to play because you are using a go to url.
I would suggest another method.
That of placing your wmv into a wm object embed tag
You can build a video jukebox via javascript functions.

First put this in the head


<*SCRIPT language="JavaScript">
function setBandwidth (connectionSpeed) {
if ((navigator.userAgent.indexOf("IE") > -1) && (navigator.platform == "Win32")) {
MediaPlayer.autoStart = true;
MediaPlayer.Filename = connectionSpeed + '.wmv';
} else {
document.MediaPlayer.SetAutoStart(true);
document.MediaPlayer1.SetFileName(connectionSpeed + '.wmv');
}
}
</SCRIPT>


Now put your wm object tag in


<OBJECT ID="MediaPlayer"
CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"
CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
WIDTH=320 HEIGHT=220
STANDBY="Loading Microsoft Windows Media Player components..."
TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="m.wmv">
<PARAM NAME="TransparentAtStart" Value="true">
<PARAM NAME="AutoStart" Value="false">
<PARAM NAME="AnimationatStart" Value="false">
<PARAM NAME="ShowControls" Value="false">
<PARAM NAME="autoSize" Value="false">
<PARAM NAME="displaySize" Value="0">
<EMBED TYPE="application/x-mplayer1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src="m.wma"
Name=MediaPlayer
AutoStart=0
Width=320 Height=220
transparent=0
autostart=0
animationAtStart=0
ShowControls=0
autoSize=0
displaySize=0>
</EMBED>
</OBJECT>


For the loading of your files.
call the javascript using just the file name without the extention

In flash you would call the event
On Event
GoTo URL javascript:setBandwidth('yourmovie');

Frets

Juniper555
09-27-2002, 03:27 AM
Wow Frets - thanks for such a detailed reply, but I am afraid that I am still feeling my way around Flash - a few questions more, please...

When you say put in the head - do you mean in the html file that calls for the wmv?

And the wm object tag - also in the html document?

I am sure that these questions show you how new to this I am!!! I really appreciate the help.

Frets
09-27-2002, 03:17 PM
yes in the head of your html document goes the script.

In the body goes the object embed tag for the media player.
As well as your object embed tag for your swf.

In an action is how you call the script to find the file name.

I've documented this for swish (different way of handling the javascript but more or less the same)
using wma's
[url=http://www.swishspot.com/sschool/l4pt4.html]Here{/url]

Juniper555
09-30-2002, 09:00 AM
Frets thanks for your patience and help!!!

I went and had a look at the site you suggested with the .wma files and it was very helpful. I am still struggling to understand how everything links together... on my page, you are given four options of video clips to view as part of a showreel. I have assigned buttons to each option.

The file I am testing with is called rhc.wmv, so I have put the action onto the button... "on (release) {
GoToURLjavascript:setBandwidth("rhc");
}

I have put the code into the head and body of the html file as you said, but I am not sure if maybe for each option of videoclip (4) I should link to a new html file with your code in those html files?

Thanks again for the patience.
J.

Frets
09-30-2002, 01:18 PM
The script doesn't call a new page.
It calls the windows media player to load a new video internally.

Something like load movie in level 0.

My advice is that you place a small clip in the default player. This will shore up load time on the page
Then use the flash/javascript function to load the new video into the player.
This way the swf doesn't have to reload.
Otherwise you would need to embed the wmp on each new page and just link to the page with the player and the wmv inside the object/embed code.

Frets

Juniper555
10-03-2002, 04:21 AM
Thanks for all the help Frets

riteshp
10-23-2002, 10:29 AM
So you saying that I can play windows media file in my swf file means my flash movie. How do I load wmv in the flash. Don't have i have to have wildform and export as swf. Or I can use wmv file. Please let me know. HOw to do that..

vinayak.kadam
06-05-2007, 08:24 AM
Hi Fret,

I was reading your comments about the object tag which we use to embed swf or video files. I have recently encountered an issue in conjunction to this as below:

I am using this object thing to embed a video in HTML page. Videos are kept in C: of the userís machine and irrespective of where the launching file runs it displays the videos. Now my requirement is to alert user with some message if the videos are not present on C: and I am unable to find any method to do this.

I would please request you to let me know if you have any solution for this.

vinayak
vinayak.kadam@techbooks.com