PDA

View Full Version : CommandLineArgs to Video Player Help


Rog Cod
04-27-2009, 08:39 AM
I am trying to do something I thought would be simple, not.

I would like to send AMS7 a command line argument to open a video, like: C:>videoplayer 1video.wmv

Open a window and play the video from the path sent from command line.

code:

address= _CommandLineArgs[1]; -- Is this correct?

Dialog.Message("Notice", address); -- test

File.Run("autorun.exe", "Page1|"..address, "", SW_SHOWNORMAL, false); -- open a pop- up player window and play the video in venerable in address.

This crates a loop opening the program and I must KILL it.

I am asking for help to just open a video from a command line args like the path and name of the file. Ex "C:\testvideos\1video.wmv" and send that to the video player window. I do not like to use Windows Media Player and need to have my own design with logo on the frame of the player window. I need a custom player that works with the command like, anyone have an idea on how to do this?

Rog Cod
04-28-2009, 08:53 AM
I found one solution and the code is not to good but it works.
I am looking for a better way ;)

Most of the code came from TJ Tigger's old posts. Thanks TJ.

sName = " ";
if _CommandLineArgs then --check that the table exists
for i,v in _CommandLineArgs do -- use a for loop to step through
if String.Left(v, 3) ~= "SFX" then -- check to see if SFXSOURCE

sName = v;

end
end

Dialog.Message("The file path", sName); -- show path to me


Plugin.SetVisible(this, true);
MediaPlayer.Load("plgMSMediaPlayer", sName); -- load it up
MovieLoaded = true; -- test for the other code not listed
Plugin.SetVisible(this, true); -- may not be needed
--Dialog.Message("After", sName); -- test removed
MediaPlayer.Stop("plgMSMediaPlayer"); -- loads a wmv only.

I have a Video window embedded to play the video on a frame window. I can't get the player to play MPG or MOV.

Anyone know how to load other codac's or have Media Player Classic load in AMS ?

Rog Cod
04-30-2009, 05:09 PM
Media Player with email.
This is a simple video player kind of an example for beginners. The code is not grate and if someone with some time could tweak it, I would be happy.

The player requires the media player plug-in. You should have Media Player Classic installed because the player should open the external player if it can't play it. You also need Outlook 2K3 or you needd to change the code to work with your email program like Outlook Express.

It is really setup to work with command line, so it can be called from command line as "MP".

If you test it you need to place the program MP.exe in drive c:\ and call the video you would like to play like this: c:\MP c:\sample\video1.wmv
and it should open in the player.

Click the EMAIL VIDEO and it should open Outlook with the video attached. I have a warning to display if the video is over 4 Meg because many ISP's will not send a video over 4 Meg.

What would be nice to see if if someone can change this to upload to YouTube or web page using FTP if a person places there site and user / password in a send dialog, just an idea.

Note: I did use an example someone made and changed some thing so it's not pretty to look at.