Search Support

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?

more options

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)

more options

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

more options

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.

more options

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.