Platforms to show: All Mac Windows Linux Cross-Platform
Required plugins for this example: MBS MacCF Plugin, MBS MacCG Plugin, MBS Main Plugin, MBS MacBase Plugin, MBS AVFoundation Plugin
Last modified Fri, 26th Dec 2013.
You find this example project in your MBS Xojo Plugin download as a Xojo project file within the examples folder: /AVFoundation/Query metadata
Download this example: Query metadata.zip
Project "Query metadata.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
app.AutoQuit = true
// pick some movie
dim f as FolderItem = SpecialFolder.Desktop.Child("test.mov")
if not f.Exists then
Break
MsgBox "pLease check movie path in code."
Return
end if
dim a as AVAssetMBS = AVAssetMBS.assetWithFile(f)
if a = nil then
MsgBox "Failed to open asset."
Return
end if
// show duration
MsgBox str(a.duration.Seconds)+" seconds"
// show creation date
dim creationDate as date = a.creationDate.dateValue
MsgBox creationDate.LongDate + " " + creationDate.LongTime
// show lyrics
MsgBox "Lyrics: "+a.lyrics
// show size
dim size as CGSizeMBS = a.naturalSize
MsgBox str(size.Width)+" x "+str(size.Height)
// shows metadata
dim items() as AVMetadataItemMBS = a.commonMetadata
for each item as AVMetadataItemMBS in items
MsgBox item.commonKey+": "+item.stringValue
next
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
Download this example: Query metadata.zip
The items on this page are in the following plugins: MBS AVFoundation Plugin.