From Xojo Documentation
|You are currently browsing the old Xojo documentation site. Please visit the new Xojo documentation site!|
Displays a control for playing movies.
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 HasController property dictates if the movie controls (if any) will be displayed. Passing False means that there will be no user controls available. Passing True means that the regular movie controls will be available.
Because movie loading is asynchronous, you should not have AutoAdjustToMovieSize = 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.
Movies do not automatically resize to fill the screen on Windows. You can alter this behavior with this code:
This code sets the movie "myHomeMovie" as the movie to be played.
This code loads a movie called "MyMovie" from the current folder into MoviePlayer1 and plays it.
f = FolderItem.ShowOpenFileDialog("MyMovie")
MoviePlayer1.HasVolumeControl = True
MoviePlayer1.HasStepControls = False
MoviePlayer1.Movie = Movie.Open(f)
If you added the movie to your project, you can assign it to the movie property with only one line of code:
The following code uses the MovieController property to get the current position of the player: