Your screen. Your subscription. Your ProMax. Start with a one-day trial ↗

Pro Max 4K OTT

Reading MediaSource lifecycle states in a web player log

A MediaSource object's readyState describes its attachment and append lifecycle.

Your first setup message. Name the device model, operating system and player edition. Pro Max 4K OTT, promax4k.tv.
Your first setup message. Name the device model, operating system and player edition. Pro Max 4K OTT, promax4k.tv.

A MediaSource object's readyState describes its attachment and append lifecycle. Its values are closed, open and ended. The HTML video element has a separate readyState with numeric media-readiness levels. A useful support log names the object as well as the property, because these two APIs answer different questions.

Start with attachment

A newly created MediaSource starts closed. In this context, closed means it is not currently attached to a media element. Open means that a media element has opened the source and its SourceBuffer objects can accept data through the appropriate operations. These states describe the application's local media pipeline. They do not report whether the streaming account is enabled or whether a remote server accepted a login.

Interpret ended at the correct layer

Ended means that the MediaSource remains attached but endOfStream() has been called. It does not mean every viewer has finished the programme, or that the browser has necessarily displayed its last frame at that instant. Buffered content and the video element's current playback position still matter. An application can also have lifecycle transitions associated with further operations, so one isolated state is weaker evidence than a sequence with timestamps.

Compare two different readyState values

For example, a diagnostic might show mediaSource.readyState as open while video.readyState remains HAVE_METADATA. That combination says the source is attached and available for appends, while the element has metadata without enough current media to progress to a higher readiness level. The next question concerns data fetching, append completion and buffered ranges. Treating open as proof that playback must already be running would skip those stages.

Report the transition that matters

Ask for sourceopen, sourceended and sourceclose events alongside media errors and the first append result, where the application records them. Note whether the transition followed a channel change, a source replacement or a normal programme end. Viewers need only describe the visible action and timing. Developers should keep internal object names in their logs so that a closed MediaSource cannot be confused with a browser tab, network socket or expired service term.

Sources & further reading

From the ProMax collection

A question? Let's sort it out.

Tell us your device, player and what happened. Start a direct conversation with Pro Max support.

Pro Max WhatsApp support card with the contact number +44 7532 814802.
Tell us your device, player and what happened. Start a direct conversation with Pro Max support.

An evening worth making time for

Get the player ready.
We’ll help with the rest.

Install the player for your screen, then WhatsApp the ProMax team for a one-day free trial. Already watching? Open the help desk for your next step.

Ask ProMax↑