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.2   6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5    Statistic  

AVPlayer.Play

Plays sound.

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

MBS( "AVPlayer.Play"; AVPlayer )

Parameters

Parameter Description Example value
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


AVPlayer.Pause   -   AVPlayer.Release

Feedback: Report problem or ask question.




Links
MBS Xojo blog