Bug 157290 - [MSE] postpone selecting media engine until type information is available
Summary: [MSE] postpone selecting media engine until type information is available
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-05-02 17:55 PDT by Eric Carlson
Modified: 2016-05-02 17:57 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2016-05-02 17:55:26 PDT
HTMLMediaElement::loadResource is called when a media element's src attribute is set/changed. It calls MediaPlayer::load with the url and content type (and media source when loading MSE), and MediaPlayer is supposed to choose the most appropriate media engine for the media type. The content type is always empty when loading from video.src, so we can't choose a media engine based on that and end up blindly selecting the first engine, MediaPlayerPrivateAVFoundationObjC. When loading a media source or media stream, the first media engine immediately rejects the call to load(), so we try the next engine, and the next if that fails, etc, etc, until one succeeds or they all fail.

While we can add methods to the MediaPlayerPrivate interface to avoid create an engine only to immediately destroy it ("mseSupported, etc), we can't have more than one MSE engine (eg. a mock engine for testing) until we have the content type made available to MediaSource::addSourceBuffer.
Comment 1 Radar WebKit Bug Importer 2016-05-02 17:57:09 PDT
<rdar://problem/26054337>