Example: /AVFoundation/MoviePlayer Rate

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/AVFoundation/MoviePlayer Rate


Required plugins for this example: MBS AVFoundation Plugin, MBS MacCG Plugin, MBS MacCF Plugin, MBS Main Plugin, MBS MacBase Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /AVFoundation/MoviePlayer Rate

This example is the version from Wed, 8th Sep 2015.

Project "MoviePlayer Rate.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
Control MoviePlayer1 Inherits MoviePlayer
ControlInstance MoviePlayer1 Inherits MoviePlayer
EventHandler Sub Open() dim f as FolderItem = SpecialFolder.Desktop.Child("test.mp4") dim m as movie = f.OpenAsMovie MoviePlayer1.movie = m End EventHandler
End Control
Control Slider1 Inherits Slider
ControlInstance Slider1 Inherits Slider
EventHandler Sub ValueChanged() MoviePlayer1.RateMBS = me.Value / 100.0 End EventHandler
End Control
End Class
MenuBar MainMenuBar
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem EditSeparator1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem EditSeparator2 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
Module ModuleMoviePlayer
Function RateMBS(extends m as MoviePlayer) As double #if TargetMacOS then #if RBVersion >= 2014.0 then // newer AVFoundation dim p as AVPlayerMBS = m.AVPlayerMBS return p.rate #else // old QuickTime return m.rate #endif #elseif TargetWin32 then #if RBVersion < 2014.0 then if m.PlayerType = 1 then // QuickTime return m.Rate end if #endif dim o as OLEObject = m.MovieController 'MsgBox o.TypeName return o.Player.settings.rate #endif End Function
Sub RateMBS(extends m as MoviePlayer, assigns r as Double) #if TargetMacOS then #if RBVersion >= 2014.0 then // newer AVFoundation dim p as AVPlayerMBS = m.AVPlayerMBS p.rate = r #else // old QuickTime m.Rate = r #endif #elseif TargetWin32 then #if RBVersion < 2014.0 then if m.PlayerType = 1 then // QuickTime m.Rate = r Return end if #endif // Windows Media Player dim o as OLEObject = m.MovieController 'MsgBox o.TypeName o.Player.settings.rate = r #endif End Sub
End Module
End Project

The items on this page are in the following plugins: MBS AVFoundation Plugin.


💬 Ask a question or report a problem