PDA

View Full Version : List box question


Bruce
06-23-2003, 02:40 PM
Hello everyone-
I'm trying to start up a .wmv movie from a List box but I don't know where to ask for the player?
This is in mt text file:
Video one::%Srcsys%\Media player.exe^%SrcDir%\video\vid1.wmv?????

Worm
06-23-2003, 03:07 PM
Why not use a File.Execute instead? That way it will open up in the End-User's favorite app that is registered to handle that particular file extension.

Bruce
06-23-2003, 03:14 PM
Ok... How would I use it in this line?
Video one::%Srcsys%\Media player.exe^%SrcDir%\video\vid1.wmv?

Bruce
06-23-2003, 08:00 PM
ANYONE PLEASE...
How would I play a .wmv video from a List box or as Worm suggested using the end users fav program?... But it must be from a List box.
Video one::%Srcsys%\Media player.exe^%SrcDir%\video\vid1.wmv?????

Worm
06-23-2003, 10:44 PM
Before we get any further with this, let's figure out what exactly you want. Do you want to have the WMV play in an exrernal player? Or do you want to use the Media Player Object within AMS to play the WMV?

If you want to play the video in an external player, then use the File.Execute to fire the WMV. Kinda like this:

%SelectedIndex% = ListBoxObject[ListBox1].GetSelected
%ItemData% = ListBoxObject[ListBox1].GetItemData (%SelectedIndex%)
%NewString% = String.GetDelimitedString ("%ItemData%", "^", 1)
File.Execute ("%NewString%", "", Continue)

Cut and Paste Version (http://www.warmuskerken.com/ams/bruce1.txt)


To play the WMV in a Media Player Object, use this:
%SelectedIndex% = ListBoxObject[ListBox1].GetSelected
%ItemData% = ListBoxObject[ListBox1].GetItemData (%SelectedIndex%)
%NewString% = String.GetDelimitedString ("%ItemData%", "^", 1)
MediaPlayerObject[MediaPlayer1].Load ("%NewSting%")
MediaPlayerObject[MediaPlayer1].Play

Cut and Paste version (http://www.warmuskerken.com/ams/bruce2.txt)

CelticDragon
06-24-2003, 05:55 AM
I have a basic bit where a list box selection displays both a whole load of info in a web browser and a video at the same time....

On double click of the list box the commands are:

%SelectedIndex% = ListBoxObject[ListBox1].GetSelected
%ItemData% = ListBoxObject[ListBox1].GetItemData (%SelectedIndex%)
WebBrowserObject[WebBrowser1].NavigateTo ("%ItemData%")
%ItemText% = ListBoxObject[ListBox1].GetItemText (Selected)
MediaPlayerObject[MediaPlayer1].Load ("%SrcDir%\%ItemText%.mpg")
MediaPlayerObject[MediaPlayer1].Play

List looks like:
Option 1::%SrcDir%\Option1.html
Option 2::%SrcDir%\Option2.html

and the videos are saved in distribution as option1.mpg and option2.mpg

CelticDragon
06-24-2003, 05:58 AM
sorry, just realised you want it to play externally. The only thing I can think of is to run the video full screen from AMS.... I had designed a background where there was a specific frame for the video to sit over so I just had the program reload the same mediaplayer so the dimensions were the same....

Bruce
06-24-2003, 09:41 AM
Worm-
how would my text.txt file read for my List Box?

Worm
06-24-2003, 09:51 AM
You really only need the Video Name, and the path to the video,

Video 1::%SrcDir%\Videos\Video1.wmv

of course if you do this, then you'll need to drop the section of code that does the delimited string actions. Simply use the %ItemData% for the path to the video.

Bruce
06-24-2003, 11:12 AM
Hummm. I'm getting an ERROR
"Could not play specific Media Player Object.
The media Player's state was incapatible with the action.
'MediaPlayer'

Just an FYI I may have more the one movie.
Any ideas?

Worm
06-24-2003, 12:04 PM
Take a look at this.

You'll need to edit the "WMV List.txt" file in the distribution folder, and put your WMVs in the WMV Folder to get it to work.

Download (http://www.warmuskerken.com/ams/wmvlist.zip)

Bruce
06-24-2003, 01:03 PM
Thx Worm!

Worm
06-24-2003, 01:29 PM
UR Welcome.