Resource

@objc(GSMediaItemResource)
@objcMembers
public class Resource : NSObject

A resource of a media.

  • uid

    Resource unique identifier.

    Declaration

    Swift

    public let uid: String
  • Resource format.

    Declaration

    Swift

    public let format: MediaItem.Format
  • Resource data size, in bytes.

    Declaration

    Swift

    public let size: UInt64
  • Resource duration in seconds (for video).

    Declaration

    Swift

    public let duration: TimeInterval?
  • Resource creation date.

    Declaration

    Swift

    public let creationDate: Date
  • Resource creation location.

    Declaration

    Swift

    public let location: CLLocation?
  • Available metaData types in this ressource.

    Declaration

    Swift

    public let metadataTypes: Set<MetadataType>
  • Tells whether the media can be streamed from the device.

    Declaration

    Swift

    public var streamable: Bool { get }
  • Gets available tracks of media. Subclasses should override this function.

    Declaration

    Swift

    public func getAvailableTracks() -> Set<Track>?
  • Resource duration in seconds. Zero if the resource is not a video or ift the duration is not available.

    Declaration

    Swift

    @objc(duration)
    var gsDuration: TimeInterval { get }
  • Tells if a metadataType is present.

    Note

    Only use in Objective-C.

    Declaration

    Swift

    @objc(hasMetadataType:)
    func hasMetadataType(_ metadataType: MediaItem.MetadataType) -> Bool

    Parameters

    metadataType

    MetadataType to check

    Return Value

    true if the metadataType type is present, false otherwise