Class PlaylistManager


  • public class PlaylistManager
    extends Sync

    Package Starting Point - The PlaylistManager, a component of the User module, allows passengers to create a list of media content, such as movies, music or audiobooks, on their personal electronic devices (PED).



    The same Playlist can be used over multiple flights, if synchronized, and passengers can add and remove media content at any time.

    • Method Detail

      • initService

        public static void initService​(Context context,
                                       IInFlightCallback inFlightCallback,
                                       InFlight inFlight)
        This api is the starting point for Playlist. The service object will be provided via IInFlightCallback once it has been initialized.
        Parameters:
        context - - Context
        inFlightCallback - IInFlightCallback - this callback will be invoked once service has been initialized.
        inFlight - - Reference of InFlight
        Example:
         FavoritesList.initService(context, inflightCallbackListener);
         

        public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.USER_PLAYLIST_V1_SERVICE.getServiceName())) { playlistV1 = (Playlist) serviceObj; playlistV1.add(playlistItem); } }

      • createPlaylist

        public Playlist createPlaylist​(java.lang.String playlistName)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getPlaylistByName

        public Playlist getPlaylistByName​(java.lang.String playlistName)
        Returns the Playlist object for the playlist name given
        Parameters:
        playlistName - name of the playlist
        Returns:
        Playlist
      • getPlaylists

        public java.util.List<Playlist> getPlaylists()
        Returns all the playlists
        Returns:
      • removePlaylist

        public void removePlaylist​(java.lang.String playlistName)
      • getFavoritesList

        public Playlist getFavoritesList()
      • setSyncListener

        public void setSyncListener​(Sync.SyncListener syncListener)
        Description copied from class: Sync
        Sets a listener to listen for the syncronization updates.
        Overrides:
        setSyncListener in class Sync
        Parameters:
        syncListener - Sync.SyncListener callback invoked indicating the result of sync operation performed.
      • synchronize

        public void synchronize()
        Description copied from class: Sync
        Triggers the synchronization.Create new playlist with nameCreate new playlist with name
        Overrides:
        synchronize in class Sync