AVPlayer.Release
----------------

Releases the audio player.

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

MBS( "AVPlayer.Release"; AVPlayer ) 

**MBS**( **"AVPlayer.Release";** /\* Releases the audio player. \*/  
**$AVPlayer**) /\* The reference number of the player.e.g. $Player \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| AVPlayer | The reference number of the player. | $Player |

### Result

Returns OK or error.

### Description

Releases the audio player.  
If you forget to release a player, the audio object stays in memory and if memory is low, FileMaker will crash.  
To avoid this the plugin will only open up to 50 files simultaneously.  
### Examples

Release player:

 #Close last movie if it was open.   
If \[Length($$Player )&gt;0\]  
 Set Variable \[$r ; Value:MBS ("AVPlayer.Release"; $$Player )\]  
 Set Variable \[$$Player ; Value:""\]  
End If  
### See also

- [AVPlayer.AddView](AVPlayerAddView.md)
- [AVPlayer.GetRate](AVPlayerGetRate.md)
- [AVPlayer.List](AVPlayerList.md)
- [AVPlayer.OpenContainer](AVPlayerOpenContainer.md)
- [AVPlayer.OpenFile](AVPlayerOpenFile.md)
- [AVPlayer.OpenURL](AVPlayerOpenURL.md)
- [AVPlayer.ReleaseAll](AVPlayerReleaseAll.md)
- [AVPlayer.SetRate](AVPlayerSetRate.md)

### Example Databases

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

This function is free to use.

Created 3th February 2017 , last changed 26th April 2023

  
[AVPlayer.Play](AVPlayerPlay.md) - [AVPlayer.ReleaseAll](AVPlayerReleaseAll.md)

[HTML Version](AVPlayerRelease.shtml)