Web Movie Player
From Xojo Documentation
Contents
The Movie Player plays a video in a Web Page. The video URL can be specified in the Inspector or via code. You can independently specify up to three versions of the same video. You specify the versions by providing separate URLs. The three versions are for:
- a desktop client
- a web client that uses Wi-Fi
- a web client that uses cellular service
This means you can easily specify different encodings and bitrates depending on the type of device and its connection speed. The client app chooses the most appropriate version to present. Normally, you use the Desktop URL for the large-size, high-bandwidth encoding; the WiFi URL for a smaller-size, high-bandwidth encoding for Mobile clients on WiFi service, and a small-size, low-bandwidth encoding for Mobile clients using cellular service.
The Movie Player control uses the browser’s native HTML5 video capabilities.
Two interesting properties can be set in the Inspector. The AllowFullScreen property displays the widget that toggles between full-screen and the size of the control in the app. The AutoPlay property starts the movie automatically when the control is displayed.
Commonly used properties and methods are listed below. Refer to WebMoviePlayer in the Language Reference for the complete list.
Properties
- When True, displays a button on the movie to allow the user to have it display using the full screen.
- When True, the movie begins playing when the control is displayed, if the browser's security/privacy settings allow it.
DesktopURL, MobileCellularURL, MobileWiFiURL
- Specifies the various movie URLs to use depending on the type of browser and its connection to the Internet.
- The duration (length) of the movie in seconds.
- The play position of the movie in seconds.
- The volume level of the movie (0 = muted, 255 = maximum).
Methods
- Used to activate or stop fast forwarding of the movie.
- Used to activate or stop fast rewinding of the movie.
- Jumps to the beginning or ending of the movie.
- Mutes or unmutes the movie sound.
- Starts playing the movie.
- Resets the Movie Player control. Call this method after changing any of the movie URLs.
- Stops playing the movie.
Usage
This sets the movie in code:
MoviePlayer1.MobileWiFiURL = "http://www.test.com/mymovie-medium.m4v"
MoviePlayer1.MobileCellularURL = "http://www.test.com/mymovie-small.m4v"
MoviePlayer1.Reset
The URLs must be actual URLs that would also work in a web browser. They cannot be local file URLs from a FolderItem.
See Also
WebMoviePlayer class; UserGuide:Web UI topic