Class

# Movie

<div class="rst-class">

forsearch

</div>

Movie

<div class="rst-class">

forsearch

</div>

Video

<div class="rst-class">

forsearch

</div>

Media

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A reference to a <span class="title-ref">Movie</span>. <span class="title-ref">Movie</span> class objects have no events.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                   | Type                               | Read-Only | Shared |
|------------------------|------------------------------------|-----------|--------|
| `Height<movie.height>` | `Integer</api/data_types/integer>` | ✓         |        |
| `Width<movie.width>`   | `Integer</api/data_types/integer>` | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                     | Parameters                                       | Returns                            | Shared |
|--------------------------|--------------------------------------------------|------------------------------------|--------|
| `Open<movie.open>`       | movieFile As `FolderItem</api/files/folderitem>` | `Movie</api/user_interface/movie>` | ✓      |
| `OpenURL<movie.openurl>` | URL As `String</api/data_types/string>`          | `Movie</api/user_interface/movie>` | ✓      |

## Property descriptions

<div id="movie.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Movie.Height

**Height** As `Integer</api/data_types/integer>`

> The actual height of the <span class="title-ref">Movie</span> in pixels.
>
> This property is read-only.
>
> This example displays the Height and Width.
>
> ``` xojo
> 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
> ```

<div id="movie.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Movie.Width

**Width** As `Integer</api/data_types/integer>`

> The actual width of the <span class="title-ref">Movie</span> in pixels.
>
> This property is read-only.
>
> This example displays the Height and Width.
>
> ``` xojo
> 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

<div id="movie.open">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Movie.Open

**Open**(movieFile As `FolderItem</api/files/folderitem>`) As `Movie</api/user_interface/movie>`

> Opens the FolderItem to be read as a <span class="title-ref">Movie</span> and returns its <span class="title-ref">Movie</span> as a <span class="title-ref">Movie</span> object.
>
> `Nil</api/language/nil>` is returned if the <span class="title-ref">Movie</span> can't be read.
>
> This example displays an open-file dialog box that lets the user select a QuickTime movie. The QuickTime <span class="title-ref">Movie</span> is then copied into the <span class="title-ref">Movie</span> property of a MoviePlayer control.
>
> ``` xojo
> Var f As FolderItem = FolderItem.ShowOpenFileDialog("video/quicktime")
>
> If f <> Nil Then
>   MoviePlayer1.Movie = Movie.Open(f)
> End If
> ```

<div id="movie.openurl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

Movie.OpenURL

**OpenURL**(URL As `String</api/data_types/string>`) As `Movie</api/user_interface/movie>`

> Opens a <span class="title-ref">Movie</span> at the specified *URL*.
>
> OpenURL is not supported on Linux.
>
> Play movies using the `DesktopMoviePlayer</api/user_interface/desktop/desktopmovieplayer>` control.
>
> The following example plays a <span class="title-ref">Movie</span> from a URL:
>
> ``` xojo
> 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</api/user_interface/desktop/desktopmovieplayer>` control or when calling the `Open<movie.open>` method of a <span class="title-ref">Movie</span> object.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

### Windows and Linux support

Although you can create a <span class="title-ref">Movie</span> object on Windows, its properties are only accurate if QuickTime is installed. On Linux, the <span class="title-ref">Movie</span> object properties are never accurate.

## Sample code

This example opens a <span class="title-ref">Movie</span> on disk, assigns it to the <span class="title-ref">Movie</span> property of a MoviePlayer object, and displays its height and width in TextFields.

``` xojo
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             |

<div class="seealso">

`Object</api/data_types/additional_types/object>` parent class; `OpenURL<movie.openurl>` function; `DesktopMoviePlayer</api/user_interface/desktop/desktopmovieplayer>`, `MobileMoviePlayer</api/user_interface/mobile/mobilemovieplayer>`, and `WebMoviePlayer</api/user_interface/web/webmovieplayer>` controls.

</div>
