Class Bookmarks


  • public class Bookmarks
    extends Sync

    Package Starting Point - Bookmarks, a component of the User module, manages the bookmarks that passengers can create.

    A bookmark allows passengers to return to a location in a specific mediaUri without scrolling. For example, the position of the playback when the media was stopped. When playback resumes, the media starts playing from that specific location.

    If synchronized, the same bookmark list can be used over multiple flights and passengers can add and remove Bookmark at any time.

    • Method Detail

      • initService

        public static void initService​(Context context,
                                       IInFlightCallback inFlightCallback,
                                       InFlight inFlight)
        This API is the starting point for Bookmarks -- Initializes the service object and returns the object with the IInFlightCallback.
        Parameters:
        context - Provides access to resources and classes to initialize the object.
        inFlightCallback - IInFlightCallback Returns the instance or error message.
        inFlight - Initializes an InFlight instance.
        Example:
         Bookmarks.initService(context, inflightCallbackListener);
         

        public void onInitServiceComplete(Object serviceObj,String serviceName) { if(serviceName.equals(InFlightServices.USER_BOOKMARK_V1_SERVICE.getServiceName())) { mBookmarkV1 = (Bookmarks) serviceObj; mBookmarkV1.add(bookmark); } }

      • getItems

        public java.util.Map<java.lang.String,​java.util.List<Bookmark>> getItems()
        Gets a map of items with their associated Bookmark.
        Returns:
        Media URIs with their associated bookmarks.
      • add

        public boolean add​(Bookmark bookmark)
                    throws UserOperationException
        Adds a single bookmark item to the end of the bookmark list.

        If the media URI is identical to a media URI currently in the playlist, the media URI will not be added.
        Parameters:
        bookmark - to be added
        Returns:
        True, if bookmark is added. If not added, the value is False.
        Throws:
        UserOperationException
      • remove

        public boolean remove​(Bookmark bookmark)
                       throws UserOperationException
        Removes an item from the bookmark list.

        The media URI is removed as an object.
        Parameters:
        bookmark - Bookmark item removed as an object.
        Returns:
        True, if the bookmark object was removed. If not removed, value is False.
        Throws:
        UserOperationException
      • remove

        public boolean remove​(java.lang.String mediaUri)
                       throws UserOperationException
        Removes the specified item from the bookmark list.
        Parameters:
        mediaUri - The media content to be removed
        Returns:
        True, if collection was modified
        False, if not modified.
        Throws:
        UserOperationException
      • 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
      • toString

        public java.lang.String toString()
        For internal use
        Overrides:
        toString in class java.lang.Object