Video Player Component
Insert a video player in a Standard Maple worksheet or document.
Component Palette Image
Video Player Component Example
The video player component can play video or audio files. The component performs an action or a series of actions to communicate with other embedded components when the player reaches specified intervals during playback, although assigning an action to a component is not required.
You can insert this embedded component from the Components palette.
There are three methods for specifying the location of the video (or audio) file:
Using a file stored locally on your computer
Providing the address of a file located on the internet
Packaging the file within the Maple worksheet
To reference a file stored locally on your computer:
Click the video player component to open the context panel.
Click Browse next to the Video File Location text box.
Browse to the location of the file, select the file, and then click Open.
To reference a file located on the internet:
Click the video player component to display the context panel.
Enter the address of the file in the Video File Location text box.
To package the video file within the MW file:
Click the video player component, and then select Component Properties.
Enter the location of the file in the Video File Location text box (this can either be an address on the internet or the path to a file on your computer).
From the File menu, select Save.
The File Save dialog opens, asking if you want to store the video content inside your worksheet.
Note: Storing the video content inside the worksheet results in a much larger worksheet file size.
If the Save As dialog opens, browse to a location to save the file, enter a file name, and then click Save.
To perform an action when the video player reaches a certain point during playback:
If you have not already done so, specify the location of a valid video file for the video player component.
Place your mouse pointer over the video component timeline.
The action editor window appears over the timeline. The action editor window holds markers at certain points in the timeline. When the video reaches a marker, the actions associated with the marker are triggered.
Place your mouse pointer over the action editor window, and then click on the action editor window.
A marker appears at the point you clicked. If you want to place the marker at a different point in the timeline, you can use your mouse to drag the marker to the desired time.
To see the time at which the actions for a marker are triggered, place your mouse over the marker. A tooltip with the time appears after a short pause.
The action editor window automatically hides itself when you remove the pointer. To have the action editor window remain visible, click the sticky button (
Right-click (Control-click for Mac) the marker, and then select Edit Action to open the Code Editor dialog for the marker.
Enter the commands you want to perform in the Code Editor dialog. For more information, see the Video Player Component Example on this page.
The video player component is customized by setting options in the Video Player control panel. To display VideoPlayer Properties, click the video component. Actions are associated with components using routines in the DocumentTools package.
The Name property is used to reference the video component when using the routines from the DocumentTools package.
The video player component supports MP4 files. There is limited support for FLV and MP3 file formats, though these have not been fully tested by Maplesoft. A list of video play file formats and associated codecs can be found here: https://docs.oracle.com/javafx/2/api/javafx/scene/media/package-summary.html#SupportedMediaTypes.
If your Video Play component is in a worksheet and the worksheet is part of a workbook, then to play any supported video file attached to the workbook:
Open the context panel to display the Video Player component properties;
Context click on the video file in the workbook navigator,
Select Copy Path. This will copy the URI of the video file to the clipboard.
Paste the URI into the Video File Location field in the context panel.
Click the play button on the Video Player.
The following table describes the control and use of the video player component options.
An x in the Get column indicates that the option can be read, that is, retrieved by using the DocumentTools[GetProperty] tool.
An x in the Set column indicates that the option can be written, that is, set by using the DocumentTools[SetProperty] tool.
The file path to the video file to display. Can also be an http:// URL to the video file.
Indicates if the video will loop and play continuously or stop when it reaches the end. If set to "true", the video loops continuously. If set to "false", looping is turned off.
Set the current position of the video file. A string of the form "mm:ss" is expected, where mm is the minute index and ss is the seconds index.
Indicates the state of the video component. Setting this option controls the video playback.
"play" to start the video playing
"stop" to stop the video
"pause" to pause the video
"ended" to set the video to being in a completed state.
"dragging" to indicate that the position is being changed.
The type of the component. This returns "VideoPlayer".
Note: To interact with the examples provided below, open this help page as a worksheet and then execute the worksheet.
This example uses a video player component and a plot component. Two markers are placed in the video player's action editor window. When the video player reaches the first marker, the plot changes from sin to cos; when the second marker is reached, the plot changes from cos to sin.
To insert the components, configure the plot component, and specify the location of the video file:
Insert a Video Player and a Plot component using the Components palette. For information on displaying the Maple palettes, see the Show Palettes help page.
Click the Plot component to display the context panel.
In the Plot Expression field, enter plot(sin).
Click the Video component to display the context panel.
Enter the location of the file in the Video File Location text box.
If you do not have a video file, enter the following:
Where MAPLEDIR is the installation directory for Maple and can be found by running the kernelopts(mapledir) command in Maple.
To place the markers in the action editor window and perform the action of changing the plot when the markers are reached:
Place your mouse pointer over the video player component timeline.
A marker appears at the point you clicked. If you want to place the marker at a different point in the timeline, you can use your mouse to drag the marker to the desired point.
Right-click (Control-click for Mac) the marker, and then select Edit Action.
This launches a dialog with preset statements and additional information on how to program actions between embedded components.
Before the end use; statement in the dialog, enter the following command:
SetProperty("Plot0", value, plot(cos));
or from the File menu, select Save Code to accept all changes.
From the File menu, select Close Code Editor.
Place a second marker in the action editor window by repeating steps 1 and 2.
Right-click (Control-click for Mac) the second marker, and then select Edit Action.
SetProperty("Plot0", value, plot(sin));
From the File menu, select Save Code to accept all changes.
Play the video. When the video player reaches the markers, the graph in the plot component changes.
Download Help Document