AVPlayer.OpenContainer
----------------------

Opens the audio file from a container.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [AVPlayer](component_AVPlayer.md) | [7.1](newinversion71.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "AVPlayer.OpenContainer"; Container ) 

**MBS**( **"AVPlayer.OpenContainer";** /\* Opens the audio file from a container. \*/  
**$Container**) /\* The container with the audio file.e.g. MyTable::MovieContainer \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Container | The container with the audio file. | MyTable::MovieContainer |

### Result

Returns player reference number or error.

### Description

Opens the audio file from a container.  
Returns the movie reference which must be released with [AVPlayer.Release](AVPlayerRelease.md) function.  
See also [AVPlayer.OpenFile](AVPlayerOpenFile.md) or [AVPlayer.OpenURL](AVPlayerOpenURL.md).  
  
Works with normal container, compressed container and referenced container file.   
  
See [WMFP.Create](WMFPCreate.md) for Windows.  
### Examples

Open from container:

 Set Variable \[$player ; Value:MBS ("AVPlayer.OpenContainer"; AVPlayer::Container )\]  
If \[MBS ("IsError")\]  
 Show Custom Dialog \["Error loading audio file."; $player \]  
 Exit Script \[\]  
End If  
Set Field \[AVPlayer::Duration ; MBS ("[AVPlayer.GetDuration](AVPlayerGetDuration.md)"; $player )\]  
Set Field \[AVPlayer::Rate ; MBS ("[AVPlayer.GetRate](AVPlayerGetRate.md)"; $$Player )\]  
Set Field \[AVPlayer::Volume ; MBS ("[AVPlayer.GetVolume](AVPlayerGetVolume.md)"; $$Player )\]  
Set Variable \[$$player ; Value:$player \]  
### See also

- [AVAsset.OpenContainer](AVAssetOpenContainer.md)
- [AVPlayer.GetDuration](AVPlayerGetDuration.md)
- [AVPlayer.GetRate](AVPlayerGetRate.md)
- [AVPlayer.GetVolume](AVPlayerGetVolume.md)
- [AVPlayer.OpenFile](AVPlayerOpenFile.md)
- [AVPlayer.OpenURL](AVPlayerOpenURL.md)
- [AVPlayer.Release](AVPlayerRelease.md)
- [IsError](IsError.md)
- [WMFP.Create](WMFPCreate.md)

### Release notes

- **Version 8.2**
    - Fixed [AVPlayer.OpenContainer](http://www.mbsplugins.eu/AVPlayerOpenContainer.shtml) to work better with various file types including mp3.

### Example Databases

- [Mac and iOS/AVPlayer](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/AVPlayer.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.2pr6](https://www.mbsplugins.de/archive/2018-05-07/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 3th February 2017 , last changed 18th June 2022

  
[AVPlayer.List](AVPlayerList.md) - [AVPlayer.OpenFile](AVPlayerOpenFile.md)

[HTML Version](AVPlayerOpenContainer.shtml)