Bug 196939 - MediaSource constructor missing
Summary: MediaSource constructor missing
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2019-04-15 15:14 PDT by Joey Parrish
Modified: 2019-04-15 21:27 PDT (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Joey Parrish 2019-04-15 15:14:33 PDT
In Safari 12.1 (13607., window.MediaSource is the constructor for MediaSource.

In Safari TP Release 79 (Safari 12.2, WebKit 13608.1.14), window.MediaSource is undefined.

In the latest WebKit nightly (r244287), my test page is in a reload loop of some kind, so I don't know the state of this in the latest WebKit.
Comment 1 Jer Noble 2019-04-15 15:31:24 PDT
Joey, any chance you've enabled the Debug menu in STP and checked the "Disable Media Source Extensions" menu in Debug -> Media Flags?
Comment 2 Joey Parrish 2019-04-15 15:37:36 PDT
I've got the "Develop" menu, if that's what you mean.  I don't see anything labeled "Debug".  In the dev menu, "Experimental Features" has nothing about MSE, and I clicked "Reset All to Defaults" for good measure.  None of the "Disable" items are checked, and I don't see MediaSource in there anyway.

What's really strange is that window.SourceBuffer _is_ there, as is window.MediaCapabilities.  If I create a video element, it reports that it can't play either MP4 or HLS.  So something seems fundamentally weird and wrong.

Am I missing something obvious or doing something dumb?
Comment 3 Joey Parrish 2019-04-15 15:41:17 PDT
Okay, I found an article about enabling the "Debug" menu, figured out how to apply it to Tech Preview (probably obvious to others, but news to me).

It turns out that those flags are indeed checked, but I never checked them.  In fact, I never had this menu enabled before now.  Could it be that these settings used to live elsewhere and were checked in an old version, then got moved to the secret Debug menu without clearing their non-default values?
Comment 4 Joey Parrish 2019-04-15 15:45:13 PDT
Okay, so clearly no bug on MSE, but I'm not sure how I ended up with those settings without ever having seen or enabled the menu.  Migration problem?

Anyway, thanks for the hint, Jer, and I'm sorry if this has been a waste of your time.
Comment 5 Jer Noble 2019-04-15 16:11:38 PDT
Yeah that's definitely weird. If this ever happens again, it would be nice to see your ~/Library/Preferences/com.apple.SafariTechnologyPreview.plist file, and see if we can figure out where preference migration went wrong.
Comment 6 Radar WebKit Bug Importer 2019-04-15 16:12:46 PDT
Comment 7 Jer Noble 2019-04-15 16:15:07 PDT
It would also be nice to hear how STP 79 was installed; an upgrade from 78? Or a fresh install? (This could affect how preferences were migrated.)
Comment 8 Joey Parrish 2019-04-15 21:27:36 PDT
It was an upgrade, but I don't know what version I had before.  I'm in the habit of installing updates, but my Mac had been turned off for some months.  So it may or may not have been an upgrade from 78, specifically, but it was definitely an upgrade.

I'm sorry I didn't take the time to wait for instructions.  It must be too late now to capture my preferences file for you.