Well I’m finally starting to see some patterns. Instead of looking for something like “AVFileTypeQuickTimeMovie”, I need to look for things like “MonoTouch.AVFoundation.AVFileType.QuickTimeMovie”. Note where the dot is between “AVFileType” and “QuickTimeMovie”.
Here’s some Apple documentation for AVFoundation constants. You may need to be logged in to see it.
Anyways, here’s the MonoTouch AVAssetExportSession.OutputFileType docs. Note this:
public virtual string OutputFileType { set; get; }
It’s a property and takes a string. So, recall the Apple docs and this:
AVFileTypeQuickTimeMovie
The actual value is “com.apple.quicktime-movie”. The constant though cannot be used in MonoTouch as there are no “constants” in the same sense/way/manner as there are in Objective-C. Instead, you need to use an AVFileType enum, which is a string, which corresponds to one of the correct values, like “com.apple.quicktime-movie”.
The Objective-C way appears to be somewhat messy coming from C#. But the way Objective-C uses constants is analogous to how C# uses enums. Enums just seem to be neater and tidier than a jumble of constants. But once I see how things work there, it finally starts to make sense.
Anyways, to assign the OutputFileType to an AVAssetExportSession (export), any of the following are ok:
export.OutputFileType = "com.apple.quicktime-movie";
export.OutputFileType = MonoTouch.AVFoundation.AVFileType.QuickTimeMovie;
export.OutputFileType = AVFileType.QuickTimeMovie;
I hope that clears up some confusion for someone. It’s pretty trivial once you know it.
http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVFoundation_Constants/Reference/reference.htmlH
Like this:
Be the first to like this post.