Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.5   7.0   7.1   7.2   7.3   7.4   7.5   8.0   8.1   8.2    Statistic  


Plays sound.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
AVPlayer 7.1 Yes No No No Yes

MBS( "AVPlayer.Play"; AVPlayer )


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


Returns OK or error.


Plays sound.


Play audio:

If [$$Player ≠ ""]
    Set Variable [$r; Value:MBS("AVPlayer.Play"; $$Player)]
    Show Custom Dialog ["Please open Movie first!"]
End If

Play with progress:

If [ $$Player ≠ "" ]
    # set progress callback
    Set Variable [ $r ; Value: MBS("AVPlayer.SetProgressEvaluate"; $$Player; "MBS(\"FM.ExecuteFileSQL\"; \"AVPlayer.fmp12\"; \"UPDATE \\\"AVPlayer\\\" SET \\\"Position\\\"=?\"; 9; 13; $$Time$$ / 1000)") ]
    Set Variable [ $r ; Value: MBS("AVPlayer.SetProgressInterval"; $$Player; 1) ]
    # now plays
    Set Variable [ $r ; Value: MBS("AVPlayer.Play"; $$Player) ]
    # commit. SQL can't update if record is edited.
    Commit Records/Requests [ With dialog: Off ]
    # Trigger script when sound is done.
    Set Variable [ $r ; Value: MBS("AVPlayer.SetFinishedScript"; $$Player; Get(FileName); "Played") ]
    Show Custom Dialog [ "Please open Movie first!" ]
End If

See also

Example Databases

AVPlayer.Pause   -   AVPlayer.Release

Feedback: Report problem or ask question.

MBS Xojo tutorial videos