Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides
New in version: 5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2    Statistic  

AVPlayer.OpenFile

Opens an audio file.

Component: AVPlayer
Version: 7.1
Mac OS X: Yes
Windows: No
Server: No
FileMaker Cloud: No

MBS( "AVPlayer.OpenFile"; Path )

Parameters

Parameter Description Example value
Path The native file path to the movie file. "/Test.mov"

Result

Returns player reference number or error.

Description

Opens an audio file.
Returns the reference number which must be released with AVPlayer.Release function.

This function requires a native path. Use Path.FileMakerPathToNativePath to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use FileDialog functions.

Examples

Open file:

Set Variable [$player; Value:MBS("AVPlayer.OpenFile"; AVPlayer::FilePath)]
If [MBS("IsError")]
    Show Custom Dialog ["Error loading audio file."; $player]
    Exit Script []
End If
Set Field [AVPlayer::Duration; MBS("AVPlayer.GetDuration"; $player)]
Set Field [AVPlayer::Rate; MBS("AVPlayer.GetRate"; $$Player)]
Set Field [AVPlayer::Volume; MBS("AVPlayer.GetVolume"; $$Player)]
Set Variable [$$player; Value:$player]

See also


AVPlayer.OpenContainer   -   AVPlayer.OpenURL

Feedback: Report problem or ask question.




Links
MBS Realbasic tutorial videos - Nachhilfe in Andernach