Mozilla Monitor website will be down for 2 hours starting 5/20/2025 at 6 AM PT. Visit our status site for updates.

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

I am trying to create 'var mediaSource = new MediaSource();' but I get 'ReferenceError: MediaSource is not defined' It worked a few days ago, what happened?

I am trying to create a MediaSource object by 'var mediaSource = new MediaSource();' but I get 'ReferenceError: MediaSource is not defined'. This method worked for the site I was developing a few days ago but keeps throwing this error. How would I go about correcting this?

I am trying to create a MediaSource object by 'var mediaSource = new MediaSource();' but I get 'ReferenceError: MediaSource is not defined'. This method worked for the site I was developing a few days ago but keeps throwing this error. How would I go about correcting this?

Chosen solution

What is the value of media.mediasource.enabled ?

You can also try:

var mediaSource = new MediaSource;

See:

[1] Available after switching the about:config preference media.mediasource.enabled to true.
Read this answer in context 👍 0

All Replies (3)

Chosen Solution

What is the value of media.mediasource.enabled ?

You can also try:

var mediaSource = new MediaSource;

See:

[1] Available after switching the about:config preference media.mediasource.enabled to true.

Modified by cor-el

cor-el said

What is the value of media.mediasource.enabled ? You can also try: var mediaSource = new MediaSource; See:
[1] Available after switching the about:config preference media.mediasource.enabled to true.

Thank you for your reply, I just figured out it was the media.mediasource.whitelist value being set to true. It is now set to false and everything is working as it should. I am not sure why my settings would have changed, maybe the recent update?

Thank you again.

Currently, the whitelist is restricted to certain youtube and netflix domains. I'm not sure how others sites can effectively use MediaSource extensions in this situation.