Windows 10 reached EOS (end of support) on October 14, 2025. If you are on Windows 10, see this article.

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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?

被采纳的解决方案

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.
定位到答案原位置 👍 0

所有回复 (3)

选择的解决方案

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.

由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.