Class

Movie

Movie

Video

Media


Description

A reference to a Movie. Movie class objects have no events.

Properties

Name

Type

Read-Only

Shared

Height

Integer

✓

Width

Integer

✓

Methods

Name

Parameters

Returns

Shared

Open

movieFile As FolderItem

Movie

✓

OpenURL

URL As String

Movie

✓

Property descriptions


Movie.Height

Height As Integer

The actual height of the Movie in pixels.

This property is read-only.

This example displays the Height and Width.

Var f As FolderItem = FolderItem.ShowOpenFileDialog("")
Var m As Movie = Movie.Open(f)

MoviePlayer1.HasBorder = True
MoviePlayer1.Movie = m
MoviePlayer1.HasController = True

TextField2.Text = m.Height.ToString
TextField3.Text = m.Width.ToString

Movie.Width

Width As Integer

The actual width of the Movie in pixels.

This property is read-only.

This example displays the Height and Width.

Var f As FolderItem = FolderItem.ShowOpenFileDialog("")
Var m As Movie = Movie.Open(f)

MoviePlayer1.HasBorder = True
MoviePlayer1.Movie = m
MoviePlayer1.HasController = True

TextField2.Text = m.Height.ToString
TextField3.Text = m.Width.ToString

Method descriptions


Movie.Open

Open(movieFile As FolderItem) As Movie

Opens the FolderItem to be read as a Movie and returns its Movie as a Movie object.

Nil is returned if the Movie can't be read.

This example displays an open-file dialog box that lets the user select a QuickTime movie. The QuickTime Movie is then copied into the Movie property of a MoviePlayer control.

Var f As FolderItem = FolderItem.ShowOpenFileDialog("video/quicktime")

If f <> Nil Then
  MoviePlayer1.Movie = Movie.Open(f)
End If

Movie.OpenURL

OpenURL(URL As String) As Movie

Opens a Movie at the specified URL.

OpenURL is not supported on Linux.

Play movies using the DesktopMoviePlayer control.

The following example plays a Movie from a URL:

MoviePlayer1.Movie = Movie.OpenURL("https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4")
MoviePlayer1.Play

Notes

Movie objects can be accessed via the Movie property of a DesktopMoviePlayer control or when calling the Open method of a Movie object.


Windows and Linux support

Although you can create a Movie object on Windows, its properties are only accurate if QuickTime is installed. On Linux, the Movie object properties are never accurate.

Sample code

This example opens a Movie on disk, assigns it to the Movie property of a MoviePlayer object, and displays its height and width in TextFields.

Var f As FolderItem = FolderItem.ShowOpenFileDialog("Logo.mov")
Var m As Movie = Movie.Open(f)

MoviePlayer1.HasBorder = True
MoviePlayer1.Movie = m
MoviePlayer1.HasController = True

TextField2.Text = m.Height.ToString
TextField3.Text = m.Width.ToString

Compatibility

Project Types

Desktop, Mobile

Operating Systems

All

See also

Object parent class; OpenURL function; DesktopMoviePlayer, MobileMoviePlayer, and WebMoviePlayer controls.