From Xojo Documentation

Class (inherits from RectControl)

Displays a control for playing movies.

Close DragOver MouseMove
ConstructContextualMenu DropObject MouseWheel
ContextualMenuAction KeyDown Open
ControllerSizeChanged KeyUp Play
DragEnter MouseEnter Stop
DragExit MouseExit

Active fa-lock-32.png Left PlayerType
AutoDeactivate LockBottom Position
AutoPlay LockLeft Scope fa-lock-32.png
AutoResize LockRight Speaker
Border fa-lock-32.png LockTop TabIndex
Controller Looping TabStop
ControllerHeight fa-lock-32.png MouseCursor Top
ControllerWidth fa-lock-32.png MouseX fa-lock-32.png Transparent
Duration fa-lock-32.png MouseY fa-lock-32.png TrueWindow fa-lock-32.png
Enabled Movie Visible
Handle fa-lock-32.png MovieController fa-lock-32.png Volume
HasStep Name Width
Height Palindrome Window fa-lock-32.png
HelpTag PanelIndex
Index fa-lock-32.png Parent

AcceptFileDrop Close Refresh
AcceptPictureDrop DrawInto RefreshRect
AcceptRawDataDrop Invalidate SetFocus
AcceptTextDrop Play Stop


Windows uses the Windows Movie Player to play movies and macOS uses AVFoundation. On Linux, the MoviePlayer uses GStreamer by default (it requires version 0,10+) and uses Xine if GStreamer is not available.

The Controller property dictates how the movie controls (if any) will be displayed. Passing 0 (zero) means that there will be no user controls available. Passing 1 means that a movie icon or badge will be displayed in the lower left corner of the movie area instead of the controller. When this badge is clicked by the user, the badge disappears and the regular movie controls appear at the bottom of the movie frame. Passing 2 displays the regular movie controls.

Because movie loading is asynchronous, you should not have AutoResize = True if you are also manually modifying the Width and Height as it is possible that the auto resizing will occur after you have changed the size.

Windows Resizing

Movies do not automatically resize to fill the screen on Windows. You can alter this behavior with this code:

Dim obj As OLEObject = MoviePlayer1.MovieController
obj.Value("stretchToFit") = True

Sample Code

This code sets the movie "myHomeMovie" as the movie to be played.

MoviePlayer1.Movie = myHomeMovie

This code loads a movie called "MyMovie" from the current directory (folder) into MoviePlayer1 and plays it.

Dim f As FolderItem
f = GetFolderItem("MyMovie")
MoviePlayer1.Speaker = True
MoviePlayer1.HasStep = False
MoviePlayer1.Movie = f.OpenAsMovie

If you added the movie to your project, you can assign it to the movie property with only one line of code:

MoviePlayer1.Movie = MyMovie

The following code uses the MovieController property to get the current position of the player:

Dim pos As Double
pos = MoviePlayer1.MovieController.Controls.CurrentPosition

See Also

OpenURLMovie function; Movie, WebMoviePlayer classes.