Online Help
The Media Player object plugin allows you to display any Windows Media Player-compatible file format (including MPEG and WMV files) on the page. It does this by taking advantage of the Windows Media Player ActiveX control that is found on most systems.
Specifically, it embeds this Windows Media Player control directly into your application. This essentially "borrows" Windows Media Player and uses it to display media files in your application.
Note: You can detect whether or not the Media Player ActiveX control is installed at run time using the Dependecies feature of AutoPlay Media Studio (see Project > Dependencies).
Note: Due to a limitation in Windows NT 4.0, a video's audio track will only be heard if the AutoPlay Media Studio audio engine is disabled. You can disable the audio engine on Windows NT 4.0 by choosing Project > Settings from the menu, selecting the Advanced tab and checking the Disable Audio Engine option. For further information, see "Disable Audio Engine" in the AutoPlay Media Studio command reference.
Please note that there are many different versions of the Windows Media Player ActiveX control. Some versions of the control do not look and operate the same as previous versions. In creating this plugin we have tried to maintain compatibility for versions 6.4-9.0 of the ActiveX control. However, you should be aware that there can be many potential issues when using any third-party ActiveX control, especially the Windows Media Player control. Therefore we strongly recommend that you test any projects that use this plugin thoroughly and use the plugin at your own risk.
If checked, the object will automatically start playing media files that are loaded using MediaPlayer.Load.
If checked, the transport controls will be displayed at run time. These controls include play, pause, stop buttons as well as volume, status and slider controls.
If checked, the media will rewind to the beginning of the clip when the stop button is pressed or the MediaPlayer.Stop action is executed.
If checked, the default Media Player context menu will be displayed if the user right-clicks the mouse on the video window. If uncheckd, no context menu will appear.
Fires when a media clip starts playing or continues playing in response to the user clicking the play button, a MediaPlayer.Play action being executed or if a clip is loaded and the "Automatically start playing on load" setting is turned on.
Fires when a media clip pauses in response to the user clicking the pause button or a MediaPlayer.Pause action being executed.
Fires when a media clip stops in response to the user clicking the stop button, a MediaPlayer.stop action being executed or the end of the clip being reached.
Fires when a media clip reaches the end of the stream during playback.
In addition to the generic "Plugin" actions supported by all plugin objects, the Media Player plugin also supports the following actions:
Gets the current playback position (in seconds) of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
(number) The current playback position of the Media Player object, in seconds.
-- Get the current playback position and the total clip length -- and display the information in a label object. This could be -- done on a page's "On Timer" event to display playback progress local length = MediaPlayer.GetLength("media_player"); local pos = MediaPlayer.GetCurrentPos("media_player"); local msg = string.format("%.2f/%.2f",pos,length); Label.SetText("time",msg);
Gets the length of the currently loaded media (in seconds) of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
(number) The length of the currently loaded media, in seconds.
-- Get the current playback position and the total clip length -- and display the information in a label object. This could be -- done on a page's "On Timer" event to display playback progress local length = MediaPlayer.GetLength("media_player"); local pos = MediaPlayer.GetCurrentPos("media_player"); local msg = string.format("%.2f/%.2f",pos,length); Label.SetText("time",msg);
Gets the current state of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
(number) The state of the Media Player object:
VIDEO_STOPPED (0) - Stopped.
VIDEO_PAUSED (1) - Paused.
VIDEO_PLAYING (2) - Playing.
-- This script could be put onto a play/pause toggle button's On Click -- event in order to toggle the text on the button if((MediaPlayer.GetState("media_player") == VIDEO_PAUSED) or (MediaPlayer.GetState("media_player") == VIDEO_STOPPED))then MediaPlayer.Play("media_player"); Button.SetText("ButtonPlay", "PAUSE"); else MediaPlayer.Pause("media_player"); Button.SetText("ButtonPlay", "PLAY"); end
Gets the volume of a Media Player object.
Note: This action does not work reliably with the Media Player 6.4 ActiveX control, but it works fine with the Media Player 9.0+ control.
(string) The name of the Media Player object that you want to apply this action to.
(number) The current volume of the Media Player object. 0 means silent, 100 is maximum volume.
-- Get the current volume level of a Media Player object nVolume = MediaPlayer.GetVolume("media_player");
Loads a media file into a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
(string) The fully qualified path and filename of the media file to load.
Nothing.
-- Display a File Browse Dialog, and then play the video that they select -- Pick a nice default folder to start the browsing in (My Documents) myfolder = Shell.GetFolder(SHF_MYDOCUMENTS); -- Show the file browse dialog strExtensions = "All Video Files (*.avi;*.mpg;*.wmv;*.asf)|*.avi;*.mpg;*.wmv;*.asf|All Files (*.*)|*.*|"; tFiles = Dialog.FileBrowse(true, "Load Video", myfolder, strExtensions, "", "", false, true); -- Only load the video if they did not press Cancel if tFiles[1] ~= "CANCEL" then -- make sure the object is visible before trying to load a video Plugin.SetVisible("media_player", true); -- Load the video File MediaPlayer.Load("media_player",tFiles[1]); -- Play the video Video.Play("Video1"); end
Pauses the playback of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
Nothing.
-- Pause playback in a Media Player object MediaPlayer.Pause("media_player");
Starts the playback of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
Nothing.
-- Start playback in a Media Player object MediaPlayer.Play("media_player");
Seeks to a position in a media clip that is loaded in a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
(number) The type of seek to perform:
SEEK_BEGINNING (0) - Seek to the beginning of the current track.
SEEK_END (1) - Seek to the end of the current track.
SEEK_FORWARD (2) - Seek forward.
SEEK_BACKWARD (3) - Seek backward.
SEEK_SPECIFIC (4) - Seek to a specific time within the track.
(number) The time in seconds to seek to (or seek by). Defaults to 0.
Note: SeekTime is only used if SeekType is 2, 3 or 4.
Nothing.
-- Rewind the media clip MediaPlayer.Seek("media_player", SEEK_BEGINNING); -- Seek forward seven and one half seconds MediaPlayer.Seek("media_player", SEEK_FORWARD, 7.5); -- Seek to fifteen seconds into the clip MediaPlayer.Seek("media_player", SEEK_SPECIFIC, 15);
Controls whether a Media Player object will play in full screen mode or at its normal size.
(string) The name of the Media Player object that you want to apply this action to.
(boolean) Whether the Media Player window should go to full screen mode. If true, the Media Player window will go to full screen mode (if it isn't already full screen). If false, it will return to normal size (if it isn't already normal).
Note: For Windows Media Player 9.0+ you must call this action after loading your media file. Calling this action before you load your media file will have no effect.
Nothing.
-- Make the Media Player object go full screen MediaPlayer.SetFullScreen("media_player", true);
Sets the volume level of a Media Player object. The volume can range from 0 (silent) to 100 (full).
Note: This action does not work reliably with the Media Player 6.4 ActiveX control, but it works fine with the Media Player 9.0+ control.
(string) The name of the Media Player object that you want to apply this action to.
(number) The volume level to set (0-100).
Nothing.
-- Set the volume to 50% MediaPlayer.SetVolume("media_player", 127);
Stops the playback of a Media Player object.
(string) The name of the Media Player object that you want to apply this action to.
Nothing.
-- Stop the playback in a Media Player object MediaPlayer.Stop("media_player");
1100 - Could not find the specified plugin object or the plugin object is of the wrong type.
Indigo Rose Corporation
support.indigorose.com
The Media Player Plugin Object is copyright © 2003-2005 Indigo Rose Software Design Corporation.
Copyright © 2003-2005 Indigo Rose Software Design Corporation.
All Rights Reserved.