Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MediaSession

The MediaSession class is the primary class that will be used to engage with the mParticle Media SDK.

Hierarchy

  • MediaSession

Index

Constructors

constructor

  • Initializes the Media Session object. This does not start a session, you can do so by calling logMediaSessionStart.

    Parameters

    • mparticleInstance: MpSDKInstance

      Your mParticle global object

    • contentId: string

      A unique identifier for your media content

    • title: string

      The title of your media content

    • duration: number

      The length of time for the complete media content (not including ads or breaks)

    • contentType: MediaContentType

      A descriptor for the type of content, i.e. Audio or Video

    • streamType: MediaStreamType

      A descriptor for the type of stream, i.e. live or on demand

    Returns MediaSession

Properties

Optional adBreak

adBreak: AdBreak

Optional adContent

adContent: AdContent

contentId

contentId: string

A unique identifier for your media content

contentType

contentType: MediaContentType

A descriptor for the type of content, i.e. Audio or Video

duration

duration: number

The length of time for the complete media content (not including ads or breaks)

mparticleInstance

mparticleInstance: MpSDKInstance

Your mParticle global object

Optional segment

segment: Segment

streamType

streamType: MediaStreamType

A descriptor for the type of stream, i.e. live or on demand

title

title: string

The title of your media content

Advertising Methods

logAdBreakEnd

  • logAdBreakEnd(): void
  • Logs when an AdBreak pod has ended

    Returns void

logAdBreakStart

  • logAdBreakStart(adBreakContent: AdBreak): void
  • Logs when an Ad Break pod has started

    Parameters

    • adBreakContent: AdBreak

      An object representing an AdBreak (collection of ads)

    Returns void

logAdClick

  • Logs when a single ad is clicked on by a visitor

    Parameters

    Returns void

logAdEnd

  • logAdEnd(): void
  • Logs when a single ad ends

    Returns void

logAdSkip

  • logAdSkip(): void
  • Logs when a single ad is skipped by a visitor

    Returns void

logAdStart

  • Logs when a single ad plays

    Parameters

    • adContent: AdContent

      An object representing a single Ad

    Returns void

Buffering Methods

logBufferEnd

  • logBufferEnd(bufferDuration: number, bufferPercent: number, bufferPosition: number): void
  • Logs the end of a buffering event

    Parameters

    • bufferDuration: number

      The duration of a buffering event

    • bufferPercent: number

      The percent that has been buffered

    • bufferPosition: number

      The playhead position of the buffering event

    Returns void

logBufferStart

  • logBufferStart(bufferDuration: number, bufferPercent: number, bufferPosition: number): void
  • Logs the start of a buffering event

    Parameters

    • bufferDuration: number

      The duration of a buffering event

    • bufferPercent: number

      The percent that has been buffered

    • bufferPosition: number

      The playhead position of the buffering event

    Returns void

Media Methods

logMediaContentEnd

  • logMediaContentEnd(): void
  • Logs when your media content has ended, usually before a post-roll ad. Must be fired between MediaSessionStart and MediaSessionEnd

    Returns void

logMediaSessionEnd

  • logMediaSessionEnd(): void
  • Ends your media session. Should be the method thing triggered, after all ads and content have been completed

    Returns void

logMediaSessionStart

  • logMediaSessionStart(): void
  • Starts your media session. Should be triggered before any prerolls or ads

    Returns void

logPause

  • logPause(): void
  • Logs a pause event

    Returns void

logPlay

  • logPlay(): void
  • Logs a play event

    Returns void

logPlayheadPosition

  • logPlayheadPosition(playheadPosition: number): void
  • Logs when the playhead position is updated

    Parameters

    • playheadPosition: number

      The updated playhead position

    Returns void

logSeekEnd

  • logSeekEnd(seekPosition: number): void
  • Logs when a visitor stops seeking

    Parameters

    • seekPosition: number

      the desired playhead position

    Returns void

logSeekStart

  • logSeekStart(seekPosition: number): void
  • Logs when a visitor starts seeking

    Parameters

    • seekPosition: number

      the desired playhead position

    Returns void

logSegmentEnd

  • logSegmentEnd(): void
  • Logs the end of a Segment or Chapter

    Returns void

logSegmentSkip

  • logSegmentSkip(): void
  • Logs when a visitor skips a Segment or Chapter

    Returns void

logSegmentStart

  • logSegmentStart(segment: Segment): void
  • Logs the start of a Segment or Chapter

    Parameters

    • segment: Segment

      An object representing a segment or chapter of content

    Returns void

Quality of Service Methods

logDroppedFrames

  • logDroppedFrames(dropped: number): void
  • Logs number of frames that have been dropped by the player

    Parameters

    • dropped: number

      Number of frames dropped

    Returns void

logQoS

  • logQoS(qos: QoS): void
  • Logs an update in the Quality of Service

    Parameters

    • qos: QoS

      An object representing QoS

    Returns void

Generated using TypeDoc