Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

WMFP.Create

Creates a new player.

Component Version macOS Windows Linux Server iOS SDK
WMFP 10.0 ❌ No ✅ Yes ❌ No ✅ Yes, on Windows ❌ No
MBS( "WMFP.Create"; URL { ; WindowRef; ControlName } )   More

Parameters

Parameter Description Example Flags
URL The URL for the video.
See Path.FilePathToFileURL function to convert file path.
"file://C:/Users/Christian/Desktop/test.MOV"
WindowRef Window Reference is the unique OS level window ID. You can obtain this by using the Window.FindByTitle or Window.FindByIndex functions. Pass zero to access the frontmost window. 0 Optional
ControlName The name of the control on your FileMaker form.
e.g. you can place a rectangle there to define the position.
"mymedia" Optional

Result

Returns reference number or error.

Description

Creates a new player.
The player can be audio only without showing in the layout or reference a layout object to play with video.
The file is loaded asynchronously, so please wait a few milliseconds or check state later.

Use WMFP.Release later to destroy the video player.

Pass no window reference and no control name to create an audio player for background playback.

See also AVPlayer.OpenContainer and AVPlayer.OpenFile for macOS and iOS.

Examples

Load video into new player:

# Create new player and load video
Set Variable [ $URL ; Value: MBS( "Path.FilePathToFileURL"; Windows Player::Path) ]
# Player is a rectangle on the layout
Set Variable [ $$player ; Value: MBS("WMFP.Create"; $URL; 0; "Player") ]
If [ MBS("IsError") ]
    Show Custom Dialog [ "Failed to load video" ; $$player ]
    Set Variable [ $$player ; Value: "" ]
Else
    # Little pause to let loading happen in background
    Pause/Resume Script [ Duration (seconds): ,1 ]
    Set Variable [ $r ; Value: MBS("WMFP.SetPlaybackEndedScriptTrigger"; $$player; Get(FileName); "Playback Done") ]
    Set Variable [ $r ; Value: MBS("WMFP.Play"; $$player) ]
End If

See also

Example Databases

Blog Entries

This function checks for a license.

Created 25th December 2019, last changed 18th June 2022


WIA.SetItemPropertyValue - WMFP.FrameStep