Applicable Model(s)

HMI5000 X Series

Title

Configuring the Media Player

Date

10/11/2010

Rev

00

P/N

0907-5076

Summary

The Media Player Object is used to play a media file on the HMI screen. The media file is stored on a USB flash drive or SD card connected to the HMI. The media player supports the following formats: avi, flv, mov, mp4, mpg/mpeg, wav, wmv. The recommended video resolution is 640 x 480, and the mp4 file format provided the best results in our testing.

This document explains how to configure the Media Player Object.

NOTE: The Media Player is available only on X series models.


Solution

To add video to a window in EasyBuilder-5000, from the Objects menu, click Media Player. The Media Player Object’s Properties dialog window appears.

The Media Player provides two options for playback control: manual and automatic. Automatic video playback begins playing a video immediately when the window containing the media player object is displayed. To enable Automatic playback in the Media Player Object’s Properties window, un-check the Enable option under the Control address section.

To enable manual video control in the Media Player Object’s Properties window, check the Enable box under the Control address section. Enabling the control address provides control for functions such as play, pause, stop, seek, zoom, and volume adjustment. These control functions are managed by setting the parameter 1 and 2 register values and writing the command value to the command register. The Media Player control address defines a series of registers used to manipulate the various video playback control functions.

The command register address is defined on the General tab in the Media Player Object’s Properties window. The subsequent register addresses contain additional parameters and video playback information as indicated below.

SettingDescription
                                              Control addressEnable control addressEnable When enabled, the Control address and subsequent registers controls the operation of the Media Player.   Disable Removes manual control of video play operation. The system will start to play the first video at designated folder when the window is opened.
CommandUsers set this address to control the operation of media player.           Command (control address + 0)
Parameter 1Parameter 1 for control operation.           Parameter 1 (control address + 1)
Parameter 2Parameter 2 for control operation           Parameter 2 (control address + 2)
StatusThe system will turn bits ON when state changes or malfunctions.           Status (control address + 3)
File indexThe register that contains the index number of the file being played. The system will write the file index value when the video begins.         File index (control address + 4)
Start timeThe register that contains the time index (seconds) at which to start the file. The default is zero.           Start time (control address + 5)
End timeThe register that contains the time index (seconds) at which to end the file.           End time (control address + 6)
      Video playing timeUpdate video playing timeEnable When checked, the Media Player will write the elapsed time of the media file into the Playing Time register.
Update periodDefines how often the Media Player writes the elapsed time of the media file into the Playing Time register. (1 to 60 seconds)
Playing timeUpdate the video elapsed time periodically. (seconds)           Playing time (control address + 7)
  Video file store locationSDPlay video files in SD card.
USB1Play video files in USB1.
USB2Play video files in USB2.
 Folder nameThe folder where the video files are stored. Files must be located in a folder (e.g. “Video”). Video files cannot be in root directory.   Note: 1. [Folder name] cannot be empty. 2. [Folder name] cannot include /\:*?”<>|.
     AttributeAuto. repeatWhen finish playing a video file, the system will automatically play the next video. e.g.  >    > …  >  
BackgroundSelect the background color of the object.

The following table lists the functions and their corresponding values that must be written into the command and parameter registers to enable the various control functions. For example, to play file 2, write a 2 in the parameter 1 register and a 1 in the command register.

Media Player Commands

CommandParameter 1Parameter 2Function
10, 1, 2, …0Plays the file indicated by Parameter 1, where 0 is the first file in the specified folder, 1 is the second file, etc.  Files are sorted in alphabetical order.
200Play the previous file.
Files are sorted in alphabetical order.  
300Play the next file.
Files are sorted in alphabetical order.  
400Play / Pause toggle. 
500Stop playing and close the file. 
61 to n-10Start playing the file at the point specified by Parameter 1, where n is the length of the file in seconds. 
71 to n-10Jump ahead to the point in the file specified by Parameter 1, where n is the length of the file in seconds. 
81 to n-10Jump back to the point in the file specified by Parameter 1, where n is the length of the file in seconds. 
90 – 1280Volume level. 
100 – 160Zoom level.  0 causes the video to fit the display object size; non-zero values adjust the magnification in 25% increments:
1 = 25%, 2 = 50%, 16 = 400%.

Select the storage device (SD card, USB1, or USB2), and indicate the folder name on the storage device containing the video file. Specify the folder on the storage device where the media file(s) reside in the Folder name: field. The root folder is not allowed; and only one level is supported. For example, an entry of “video” specifies the folder “video” on the USB device, and is allowed. An entry of “video\files” specifies the folder “files” under the folder “video,” and is not allowed.

Click the Preview tab to load the media file and view the file. If the file plays in the Preview tab, it will play in the simulator and in the HMI.

Two sample Media Player projects are available in the Support Center on our Website. The BasicMediaPlayer project is configured without the control function enabled, and the MediaPlayerControl project incorporates many of the control features.

Scroll to Top