Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Creates a new player.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
WMFP | 10.0 | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |
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 |
Returns reference number or error.
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
This function checks for a license.
Created 25th December 2019, last changed 18th June 2022