Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4    Statistic    FMM    Blog  

AVPlayer.Play

Plays sound.

Component Version macOS Windows Linux Server iOS SDK
AVPlayer 7.1 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes
MBS( "AVPlayer.Play"; AVPlayer )   More

Parameters

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

Result

Returns OK or error.

Description

Plays sound.

Examples

Play audio:

If [$$Player ≠ ""]
    Set Variable [$r; Value:MBS("AVPlayer.Play"; $$Player)]
Else
    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") ]
Else
    Show Custom Dialog [ "Please open Movie first!" ]
End If

See also

Example Databases

Created 3th February 2017, last changed 8th September 2017


AVPlayer.Pause - AVPlayer.Release

Feedback: Report problem or ask question.