Hello I am trying to assign some metadata
to my AVExportSession
so that the output files have the same metadata
attached as the AVExportSession
.
I have tried import AVFoundation
import AVKit
and a combo of the two.
The AVMutableMetaDataItem.value
is unable to be set because the compiler will reference NSObject.value
property or its NSObject.setValue(forKey:)
method
I have tried creating a playground and just creating the Mutable Metadata item without the same errors
When trying to subclass AVMutableMetaDataItem
and trying to override its open var value
property, the compiler will then complain the value we are overriding is read-only in reference to its non-mutable counterpart AVMetaDataItem.value
Does a radar need to be filled or is there something I am not doing correctly with creating an AVMutableMetaDataItem
?
The value property of AVMutableMetadataItem
has type (NSCopying & NSObjectProtocol)?
and is settable. In order to assign to the value
property you need an object that conforms to these protocols. Below is a code snippet that illustrates the basic idea:
let newLocationMetadataItem = AVMutableMetadataItem()
newLocationMetadataItem.identifier = AVMetadataIdentifier.quickTimeMetadataLocationISO6709
newLocationMetadataItem.dataType = kCMMetadataDataType_QuickTimeMetadataLocation_ISO6709 as String
let iso6709Geolocation = String(format: "%+08.4lf%+09.4lf/", -30.0368, -51.2090)
newLocationMetadataItem.value = iso6709Geolocation as NSString