Class Media


  • public final class Media
    extends Object
    • Method Detail

      • getSessionId

        public String getSessionId()
        Get session
        Returns:
        String
      • setPlaybackSpeed

        public void setPlaybackSpeed​(double playbackSpeed)
        Set a new playback speed and update session context
        Parameters:
        playbackSpeed - double
      • heartbeat

        public void heartbeat​(int cursorPosition,
                              Map<String,​Object> extraProps)
        Generate heartbeat event.
      • bufferHeartbeat

        public void bufferHeartbeat​(Map<String,​Object> extraProps)
        Generate heartbeat event during buffering.
      • rebufferHeartbeat

        public void rebufferHeartbeat​(Map<String,​Object> extraProps)
        Generate heartbeat event during rebuffering.
      • play

        public void play​(int cursorPosition,
                         Map<String,​Object> extraProps)
        Generate play event (play attempt).
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • bufferStart

        public void bufferStart​(int cursorPosition,
                                Map<String,​Object> extraProps)
        Player buffering start to initiate the launch of the media.
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • playbackStart

        public void playbackStart​(int cursorPosition,
                                  Map<String,​Object> extraProps)
        Media playback start (first frame of the media).
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • playbackResumed

        public void playbackResumed​(int cursorPosition,
                                    Map<String,​Object> extraProps)
        Media playback restarted manually after a pause.
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • playbackPaused

        public void playbackPaused​(int cursorPosition,
                                   Map<String,​Object> extraProps)
        Media playback paused.
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • playbackStopped

        public void playbackStopped​(int cursorPosition,
                                    Map<String,​Object> extraProps)
        Media playback stopped.
        Parameters:
        cursorPosition - Cursor position (milliseconds)
      • seek

        public void seek​(int oldCursorPosition,
                         int newCursorPosition,
                         Map<String,​Object> extraProps)
        Measuring seek event.
        Parameters:
        oldCursorPosition - Starting position (milliseconds)
        newCursorPosition - Ending position (milliseconds)
      • seekBackward

        public void seekBackward​(int oldCursorPosition,
                                 int newCursorPosition,
                                 Map<String,​Object> extraProps)
        Measuring seek backward.
        Parameters:
        oldCursorPosition - Starting position (milliseconds)
        newCursorPosition - Ending position (milliseconds)
      • seekForward

        public void seekForward​(int oldCursorPosition,
                                int newCursorPosition,
                                Map<String,​Object> extraProps)
        Measuring seek forward.
        Parameters:
        oldCursorPosition - Starting position (milliseconds)
        newCursorPosition - Ending position (milliseconds)
      • seekStart

        public void seekStart​(int oldCursorPosition,
                              Map<String,​Object> extraProps)
        Measuring seek start.
        Parameters:
        oldCursorPosition - Old Cursor position (milliseconds)
      • adClick

        public void adClick​(Map<String,​Object> extraProps)
        Measuring media click (especially for ads).
      • adSkip

        public void adSkip​(Map<String,​Object> extraProps)
        Measuring media skip (especially for ads).
      • error

        public void error​(String message,
                          Map<String,​Object> extraProps)
        Error measurement preventing reading from continuing.
      • display

        public void display​(Map<String,​Object> extraProps)
        Measuring reco or Ad display.
      • close

        public void close​(Map<String,​Object> extraProps)
        Measuring close action.
      • volume

        public void volume​(Map<String,​Object> extraProps)
        Measurement of a volume change action.
      • subtitleOn

        public void subtitleOn​(Map<String,​Object> extraProps)
        Measurement of activated subtitles.
      • subtitleOff

        public void subtitleOff​(Map<String,​Object> extraProps)
        Measurement of deactivated subtitles.
      • fullscreenOn

        public void fullscreenOn​(Map<String,​Object> extraProps)
        Measuring a full-screen display.
      • fullscreenOff

        public void fullscreenOff​(Map<String,​Object> extraProps)
        Measuring a full screen deactivation.
      • quality

        public void quality​(Map<String,​Object> extraProps)
        Measurement of a quality change action.
      • speed

        public void speed​(Map<String,​Object> extraProps)
        Measurement of a speed change action.
      • share

        public void share​(Map<String,​Object> extraProps)
        Measurement of a sharing action.
      • setHeartbeat

        public Media setHeartbeat​(SparseIntArray heartbeat)
        Set heartbeat value
        Parameters:
        heartbeat - SparseIntArray
        Returns:
        current Media instance
      • setBufferHeartbeat

        public Media setBufferHeartbeat​(SparseIntArray bufferHeartbeat)
        Set buffer heartbeat value
        Parameters:
        bufferHeartbeat - SparseIntArray
        Returns:
        current Media instance