AudioPlayer
@objc open class AudioPlayer: BasePlayer
Audio Player Class handle the Audio share,control and TV Player queue.
-
The Audio Player delegate protocol defines the event methods available for a Audio.
Declaration
Swift
open weak var playerDelegate: AudioPlayerDelegate? = nil -
Enum for Player list mode Supported mode: repeatAll,repeatOff,repeatSingle
See moreDeclaration
Swift
@objc public enum AudioRepeatMode: Int
-
this method play Audio content on TV.
Declaration
Swift
@objc open func playContent(_ contentURL: URL, completionHandler: ((NSError?) -> Void)? = nil)Parameters
contentURLAudio Url
completionHandlerThe response completion closure, it will be executed in the request queue i.e. in a backgound thread.
-
play Audio content on TV.
Declaration
Swift
@objc open func playContent(_ contentURL: URL?, title: String, albumName: String, albumArtUrl: URL?, completionHandler: ((NSError?) -> Void)? = nil)Parameters
contentURLContent URL
titleContent Title
albumNameContent album name
albumArtUrlContent thumbnail URL
completionHandlerThe response completion closure, it will be executed in the request queue i.e. in a backgound thread.
-
Seek the given time in currently playing media.
Declaration
Swift
@objc open func seek(_ time: TimeInterval)Parameters
timeTime in seconds within length of currently playing media.
-
resumes TV widget/application from background process.
Declaration
Swift
@objc open func resumeApplicationInForeground(_ completionHandler: ((NSError?) -> Void)? = nil)Parameters
completionHandlerThe response completion closure, it will be executed in the request queue i.e. in a backgound thread.
-
repeat player list.
Declaration
Swift
@objc open func `repeat`() -
Set player list mode Supported mode: repeatAll,repeatOff,repeatSingle
Declaration
Swift
@objc open func setRepeat(_ mode: AudioRepeatMode) -
shuffle player list.
Declaration
Swift
@objc open func shuffle() -
shuffle player list.
Declaration
Swift
@objc open func setShuffle(_ mode: Bool) -
request player list i.e currently playing on TV.
Declaration
Swift
@objc open func getList() -
request to delete(removeAll) player list.
Declaration
Swift
@objc open func clearList() -
remove specific audio from player list.
Declaration
Swift
@objc open func removeFromList(_ contentURL: URL)Parameters
contentURLAudio URL
-
Add Audio item to player list.
Declaration
Swift
@objc open func addToList(_ contentURL: URL, title: String = "", albumName: String = "", albumArtUrl: URL = URL(fileURLWithPath: ""))Parameters
contentURLURL
titleTitle
albumNameAlbum NAme
albumArtUrlthumbnail URL
-
Add Audio item to player list.
Declaration
Swift
@objc public func addToList(_ arrayDictofData: [[String: AnyObject]])Parameters
arrayDictofDatalist data in form array of dictionary
-
Notification of any data received from TV player
Declaration
Swift
open func onMessage(_ notification: Notification!)Parameters
notificationcontains player queue event and action
AudioPlayer Class Reference