| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
AVPlayer.GetRate
Queries playback rate.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| AVPlayer | 7.1 | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |
MBS( "AVPlayer.GetRate"; AVPlayer ) More
Parameters
| Parameter | Description | Example |
|---|---|---|
| AVPlayer | The reference number of the player. | $Player |
Result
Returns value or error.
Description
Queries playback rate.Rate is 1.0 by default.
You for example can use 0.5 to play half speed or 2.0 for double speed.
Examples
Try the function:
# Step 1: Choose a video file
Set Variable [ $filePath ; Value: MBS( "FileDialog.OpenFile" ) ]
# Exit if user cancels
If [ IsEmpty($filePath) ]
Show Custom Dialog [ "Cancelled" ; "No file selected." ]
Exit Script []
End If
# Step 2: Open the file with AVPlayer and get a player reference
Set Variable [ $playerRef ; Value: MBS( "AVPlayer.OpenURL"; $filePath ) ]
# Check if the player was created
If [ IsEmpty($playerRef) ]
Show Custom Dialog [ "Error" ; "Failed to create AVPlayer instance." ]
Exit Script []
End If
# Step 3: Optionally start playback (so rate is > 0)
Set Variable [ $result ; Value: MBS( "AVPlayer.Play"; $playerRef ) ]
# Add delay (so video starts playing)
Pause/Resume Script [ Duration (seconds): 1 ]
# Step 4: Get current playback rate
Set Variable [ $rate ; Value: MBS( "AVPlayer.GetRate"; $playerRef ) ]
# Step 5: Show the rate
Show Custom Dialog [ "Playback Rate" ; "Current playback rate: " & $rate ]
Set Variable [ $filePath ; Value: MBS( "FileDialog.OpenFile" ) ]
# Exit if user cancels
If [ IsEmpty($filePath) ]
Show Custom Dialog [ "Cancelled" ; "No file selected." ]
Exit Script []
End If
# Step 2: Open the file with AVPlayer and get a player reference
Set Variable [ $playerRef ; Value: MBS( "AVPlayer.OpenURL"; $filePath ) ]
# Check if the player was created
If [ IsEmpty($playerRef) ]
Show Custom Dialog [ "Error" ; "Failed to create AVPlayer instance." ]
Exit Script []
End If
# Step 3: Optionally start playback (so rate is > 0)
Set Variable [ $result ; Value: MBS( "AVPlayer.Play"; $playerRef ) ]
# Add delay (so video starts playing)
Pause/Resume Script [ Duration (seconds): 1 ]
# Step 4: Get current playback rate
Set Variable [ $rate ; Value: MBS( "AVPlayer.GetRate"; $playerRef ) ]
# Step 5: Show the rate
Show Custom Dialog [ "Playback Rate" ; "Current playback rate: " & $rate ]
See also
- AVPlayer.GetAsset
- AVPlayer.GetMuted
- AVPlayer.GetTag
- AVPlayer.OpenFile
- AVPlayer.OpenURL
- AVPlayer.Release
- AVPlayer.SetMuted
- AVPlayer.SetRate
- AVPlayer.SetTag
- AVPlayer.SetTime
Example Databases
This function checks for a license.
Created 3th February 2017, last changed 12nd June 2025
AVPlayer.GetProgressInterval - AVPlayer.GetShowsFrameSteppingButtons