Expand Minimize Picture-in-picture Power Device Status Voice Recognition Skip Back Skip Forward Minus Plus Play Search
Internet Explorer alert
This browser is not recommended for use with smartdevicelink.com, and may not function properly. Upgrade to a different browser to guarantee support of all features.
close alert
To Top Created with Sketch. To Top
To Bottom Created with Sketch. To Bottom
iOS Documentation
SDLMediaServiceData

SDLMediaServiceData Class Reference

Section Contents

Overview

This data is related to what a media service should provide.

-initWithMediaType:mediaImage:mediaTitle:mediaArtist:mediaAlbum:playlistName:isExplicit:trackPlaybackProgress:trackPlaybackDuration:queuePlaybackProgress:queuePlaybackDuration:queueCurrentTrackNumber:queueTotalTrackCount:

Convenience init

Objective-C

- (nonnull instancetype)initWithMediaType:(nullable SDLMediaType)mediaType
                               mediaImage:(nullable SDLImage *)mediaImage
                               mediaTitle:(nullable NSString *)mediaTitle
                              mediaArtist:(nullable NSString *)mediaArtist
                               mediaAlbum:(nullable NSString *)mediaAlbum
                             playlistName:(nullable NSString *)playlistName
                               isExplicit:(BOOL)isExplicit
                    trackPlaybackProgress:(UInt32)trackPlaybackProgress
                    trackPlaybackDuration:(UInt32)trackPlaybackDuration
                    queuePlaybackProgress:(UInt32)queuePlaybackProgress
                    queuePlaybackDuration:(UInt32)queuePlaybackDuration
                  queueCurrentTrackNumber:(UInt32)queueCurrentTrackNumber
                     queueTotalTrackCount:(UInt32)queueTotalTrackCount;

Swift

init(mediaType: SDLMediaType?, mediaImage: SDLImage?, mediaTitle: String?, mediaArtist: String?, mediaAlbum: String?, playlistName: String?, isExplicit: Bool, trackPlaybackProgress: UInt32, trackPlaybackDuration: UInt32, queuePlaybackProgress: UInt32, queuePlaybackDuration: UInt32, queueCurrentTrackNumber: UInt32, queueTotalTrackCount: UInt32)

Parameters

mediaType

The type of the currently playing or paused track

mediaImage

The current artwork for the playing media.

mediaTitle

The name of the current playing media

mediaArtist

The name of the current media artist

mediaAlbum

The name of the current media album

playlistName

The name of the playlist

isExplicit

Whether or not the content currently playing contains explicit content

trackPlaybackProgress

The current progress of the track

trackPlaybackDuration

The total duration of the track

queuePlaybackProgress

The current progress of the playback queue in seconds

queuePlaybackDuration

The total duration of the playback queue in seconds

queueCurrentTrackNumber

The current number (1 based) of the track in the playback queue

queueTotalTrackCount

The total number of tracks in the playback queue

Return Value

A SDLMediaServiceData object

mediaImage

Sets the media image associated with the currently playing media Music: The album art of the current track Podcast: The podcast or chapter artwork of the current podcast episode Audiobook: The book or chapter artwork of the current audiobook

SDLImage, Optional

Objective-C

@property (nonatomic, strong, nullable) SDLImage *mediaImage;

Swift

var mediaImage: SDLImage? { get set }

mediaType

The type of the currently playing or paused track.

SDLMediaType, Optional

Objective-C

@property (nonatomic, strong, nullable) SDLMediaType mediaType;

Swift

var mediaType: SDLMediaType? { get set }

mediaTitle

Music: The name of the current track Podcast: The name of the current episode Audiobook: The name of the current chapter

String, Optional

Objective-C

@property (nonatomic, strong, nullable) NSString *mediaTitle;

Swift

var mediaTitle: String? { get set }

mediaArtist

Music: The name of the current album artist Podcast: The provider of the podcast (hosts, network, company) Audiobook: The book author’s name

String, Optional

Objective-C

@property (nonatomic, strong, nullable) NSString *mediaArtist;

Swift

var mediaArtist: String? { get set }

mediaAlbum

Music: The name of the current album Podcast: The name of the current podcast show Audiobook: The name of the current book

String, Optional

Objective-C

@property (nonatomic, strong, nullable) NSString *mediaAlbum;

Swift

var mediaAlbum: String? { get set }

playlistName

Music: The name of the playlist or radio station, if the user is playing from a playlist, otherwise, Null Podcast: The name of the playlist, if the user is playing from a playlist, otherwise, Null Audiobook: Likely not applicable, possibly a collection or “playlist” of books

String, Optional

Objective-C

@property (nonatomic, strong, nullable) NSString *playlistName;

Swift

var playlistName: String? { get set }

isExplicit

Whether or not the content currently playing (e.g. the track, episode, or book) contains explicit content.

Boolean, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLBool> *isExplicit;

Swift

var isExplicit: (NSNumber & SDLBool)? { get set }

trackPlaybackProgress

Music: The current progress of the track in seconds Podcast: The current progress of the episode in seconds Audiobook: The current progress of the current segment (e.g. the chapter) in seconds

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *trackPlaybackProgress;

Swift

var trackPlaybackProgress: (NSNumber & SDLInt)? { get set }

trackPlaybackDuration

Music: The total duration of the track in seconds Podcast: The total duration of the episode in seconds Audiobook: The total duration of the current segment (e.g. the chapter) in seconds

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *trackPlaybackDuration;

Swift

var trackPlaybackDuration: (NSNumber & SDLInt)? { get set }

queuePlaybackProgress

Music: The current progress of the playback queue in seconds Podcast: The current progress of the playback queue in seconds Audiobook: The current progress of the playback queue (e.g. the book) in seconds

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *queuePlaybackProgress;

Swift

var queuePlaybackProgress: (NSNumber & SDLInt)? { get set }

queuePlaybackDuration

Music: The total duration of the playback queue in seconds Podcast: The total duration of the playback queue in seconds Audiobook: The total duration of the playback queue (e.g. the book) in seconds

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *queuePlaybackDuration;

Swift

var queuePlaybackDuration: (NSNumber & SDLInt)? { get set }

queueCurrentTrackNumber

Music: The current number (1 based) of the track in the playback queue Podcast: The current number (1 based) of the episode in the playback queue Audiobook: The current number (1 based) of the episode in the playback queue (e.g. the chapter number in the book)

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *queueCurrentTrackNumber;

Swift

var queueCurrentTrackNumber: (NSNumber & SDLInt)? { get set }

queueTotalTrackCount

Music: The total number of tracks in the playback queue Podcast: The total number of episodes in the playback queue Audiobook: The total number of sections in the playback queue (e.g. the number of chapters in the book)

Integer, Optional

Objective-C

@property (nonatomic, strong, nullable) NSNumber<SDLInt> *queueTotalTrackCount;

Swift

var queueTotalTrackCount: (NSNumber & SDLInt)? { get set }
View on GitHub.com
Previous Section Next Section