X
Tap here to go to the mobile version of the site.

منتدى الدعم

In Firefox 38 and above, HTML video element doesn't play mp4 videos

Posted

We're using a URL like "http://.....*.mp4", which will play the mp4 video files in mozilla firefox. In our code we are using <Video> element, and the video is getting played up to Firefox 37.0. After upgrading to Firefox 38.0 the video is not getting played.

The error message "Media Resource could not be decoded" is displayed on debugging to the following line:

document.getElementById("Video2").src="http://...*.mp4"

<video id="Video2" controls/>
We're using a URL like "http://.....*.mp4", which will play the mp4 video files in mozilla firefox. In our code we are using &lt;Video> element, and the video is getting played up to Firefox 37.0. After upgrading to Firefox 38.0 the video is not getting played. The error message "Media Resource could not be decoded" is displayed on debugging to the following line: <pre><nowiki> document.getElementById("Video2").src="http://...*.mp4" <video id="Video2" controls/></nowiki></pre>

Modified by cor-el

Additional System Details

Application

  • User Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.130 Safari/537.36

More Information

guigs 1072 solutions 11697 answers

What does the computer say that is affected for H.264 on https://www.youtube.com/html5 ?

What is the encoding of the videos that are being called?

If you open about:config, what is the configuration for: media.windows-media-foundation.enabled

What does the computer say that is affected for H.264 on [https://www.youtube.com/html5] ? What is the encoding of the videos that are being called? If you open about:config, what is the configuration for: media.windows-media-foundation.enabled

Question owner

My browser is supporting H.264 (see the attached Screenshot) and the media.windows-media-foundation.enabled is set to its default as true.

My browser is supporting H.264 (see the attached Screenshot) and the media.windows-media-foundation.enabled is set to its default as true.
cor-el
  • Top 10 Contributor
  • Moderator
17681 solutions 159964 answers

You may have to recode the video.

Does the same happen if you open the video link directly via the location/address bar?

What video and Audio codecs are used if you check that in an external player that has such a capability?

You may have to recode the video. Does the same happen if you open the video link directly via the location/address bar? What video and Audio codecs are used if you check that in an external player that has such a capability?
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

What if you set the video source this way (including a content type):

var newsrc = "your-uri"; if (document.getElementById("Video2source")) { document.getElementById("Video2source") = newsrc; } else { var vidsrc = document.createElement("source"); vidsrc.id = "Video2source"; vidsrc.type = "video/mp4"; vidsrc.src = newsrc; document.getElementById("Video2").appendChild(vidsrc); }

Note: that's air code, typed and untested.

If that doesn't help, can you check the console (Browser Console, Web Console, or Network Monitor) and confirm that the server is sending video/mp4 as the content type for the video?

What if you set the video source this way (including a content type): <code>var newsrc = "''your-uri''"; if (document.getElementById("Video2source")) { document.getElementById("Video2source") = newsrc; } else { var vidsrc = document.createElement("source"); vidsrc''.''id = "Video2source"; vidsrc.type = "video/mp4"; vidsrc.src = newsrc; document.getElementById("Video2").appendChild(vidsrc); }</code> Note: that's air code, typed and untested. If that doesn't help, can you check the console (Browser Console, Web Console, or Network Monitor) and confirm that the server is sending video/mp4 as the content type for the video?

Question owner

The code we're using is given below: <video id="Video2" controls="controls" width="640" height="360"> <source type="video/mp4" /> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="420" width="240"> <param name="src" value="ProgressiveDownload.mp4" /> </object> </video>

The Response.Headers is gives the "Content-Type: video/mp4" value. In Console the error message "Media resource could not be decoded" is displayed.


Edit to display code, as requested by jscher2000 {use < nowiki > tags}~J99

The code we're using is given below: <nowiki> <video id="Video2" controls="controls" width="640" height="360"> <source type="video/mp4" /> <object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="420" width="240"> <param name="src" value="ProgressiveDownload.mp4" /> </object> </video> </nowiki> The Response.Headers is gives the "Content-Type: video/mp4" value. In Console the error message "Media resource could not be decoded" is displayed. ----------- Edit to display code, as requested by jscher2000 {use < nowiki > tags}~J99

Modified by John99

jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

Aabaavaanan said

The code we're using is given below:

<video id="Video2" controls="controls" width="640" height="360">
<source type="video/mp4" />
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="420" width="240">
<param name="src" value="ProgressiveDownload.mp4" />
</object>
</video>

The object fallback is coded for IE (classid), so Firefox isn't going to use that. But as for the decoding issue, can you give a link to a page that demonstrates this problem?

''Aabaavaanan [[#answer-766278|said]]'' <blockquote> The code we're using is given below:<br><br> <code>&lt;video id="Video2" controls="controls" width="640" height="360"><br> &lt;source type="video/mp4" /><br> &lt;object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="420" width="240"><br> &lt;param name="src" value="ProgressiveDownload.mp4" /><br> &lt;/object><br> &lt;/video></code> </blockquote> The object fallback is coded for IE (classid), so Firefox isn't going to use that. But as for the decoding issue, can you give a link to a page that demonstrates this problem?

Question owner

Sorry, i couldn't share the video link due to confidentiality...

while debugging in firefox 38 and above, after executing the line

document.getElementById("Video2").src="http://...*.mp4"

the error "Media Resource could not be decoded" is displayed on Console

Sorry, i couldn't share the video link due to confidentiality... while debugging in firefox 38 and above, after executing the line document.getElementById("Video2").src="http://...*.mp4" the error "Media Resource could not be decoded" is displayed on Console
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

Any difference if you change that code to set the src attribute of the <source> tag where you have the content type set:

if (document.querySelector) document.querySelector("#Video2 > source").src="http://...*.mp4";

Any difference if you change that code to set the src attribute of the &lt;source> tag where you have the content type set: if (document.querySelector) document.querySelector("#Video2 > source").src="http://...*.mp4";

Question owner

Hi

Still couldnt play the video.Please try to play any video file of mp4 format in firefox. It isntg working.

Can u pls check ASAP.

Thanks.

Hi Still couldnt play the video.Please try to play any video file of mp4 format in firefox. It isntg working. Can u pls check ASAP. Thanks.
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

On Windows 7? I play MP4 video all the time, including YouTube and this test site: http://www.quirksmode.org/html5/tests/video.html

Do you have one of the editions of Windows 7 that doesn't include Media Foundation? In that case you would need to add it. See: https://www.microsoft.com/en-us/download/details.aspx?id=16546

On Windows 7? I play MP4 video all the time, including YouTube and this test site: http://www.quirksmode.org/html5/tests/video.html Do you have one of the editions of Windows 7 that doesn't include Media Foundation? In that case you would need to add it. See: https://www.microsoft.com/en-us/download/details.aspx?id=16546
EL20 0 solutions 17 answers

If this can be of any help, I posted this issue a few months ago, and easily solved it using FredMcD's solution.

You can find the post in question there: https://support.mozilla.org/en-US/questions/1048378

If this can be of any help, I posted this issue a few months ago, and easily solved it using FredMcD's solution. You can find the post in question there: '''https://support.mozilla.org/en-US/questions/1048378'''

Question owner

We are using windows 7 which include Media Foundation.

We are using windows 7 which include Media Foundation.
EL20 0 solutions 17 answers

Well, excuse me, but nowhere did you specify that you run Windows 7.

Either way, I am sorry that my contribution is not helping.

Well, excuse me, but nowhere did you specify that you run Windows 7. Either way, I am sorry that my contribution is not helping.
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

Hi Aabaavaanan, do you get the same error on the test page?

http://www.quirksmode.org/html5/tests/video.html

I'm trying to think of what changed in Firefox 38 that might be affecting MPEG decoding and nothing is coming to mind.


Could you do this three-minute experiment:

Create a new Firefox profile

A new profile will have your system-installed plugins (e.g., Flash) and extensions (e.g., security suite toolbars), but no themes, other extensions, or other customizations. It also should have completely fresh settings databases and a fresh cache folder.

Exit Firefox and start up in the Profile Manager using Start > search box (or Run):

firefox.exe -P

Don't delete anything here!

Any time you want to switch profiles, exit Firefox and return to this dialog.

Click the Create Profile button, assign a name like TEST081215, and skip the option to relocate the profile folder. After creating the profile, select it and start Firefox in that profile.

Any difference?

When returning to the Profile Manager, you might be tempted to use the Delete Profile button. But... it's a bit too easy to accidentally delete your "real" profile, so I recommend resisting the temptation. If you do want to clean up later, I suggest making a backup of all your profiles first in case something were to go wrong.

Hi Aabaavaanan, do you get the same error on the test page? http://www.quirksmode.org/html5/tests/video.html I'm trying to think of what changed in Firefox 38 that might be affecting MPEG decoding and nothing is coming to mind. ---- Could you do this three-minute experiment: '''Create a new Firefox profile''' A new profile will have your system-installed plugins (e.g., Flash) and extensions (e.g., security suite toolbars), but no themes, other extensions, or other customizations. It also should have completely fresh settings databases and a fresh cache folder. Exit Firefox and start up in the Profile Manager using Start > search box (or Run): firefox.exe -P ''Don't delete anything here!'' Any time you want to switch profiles, exit Firefox and return to this dialog. Click the Create Profile button, assign a name like TEST081215, and skip the option to relocate the profile folder. After creating the profile, select it and start Firefox in that profile. Any difference? When returning to the Profile Manager, you might be tempted to use the Delete Profile button. But... it's a bit too easy to accidentally delete your "real" profile, so I recommend resisting the temptation. If you do want to clean up later, I suggest making a backup of all your profiles first in case something were to go wrong.
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

Hi EL20, I think that last reply was directed to my comment, so please don't take it as criticism of your comment. This forum doesn't have "threaded" replies so it's sometimes hard to follow.

Hi EL20, I think that last reply was directed to my comment, so please don't take it as criticism of your comment. This forum doesn't have "threaded" replies so it's sometimes hard to follow.

Question owner

Hi,

We have found that the Video file of lesser size (less than 1.5 GB) is able to play in firefox but greater than that is not playing.

I Think this might be the exact issue.

Please check and let us know for any update asap.

Thanks

Hi, We have found that the Video file of lesser size (less than 1.5 GB) is able to play in firefox but greater than that is not playing. I Think this might be the exact issue. Please check and let us know for any update asap. Thanks
jscher2000
  • Top 10 Contributor
8837 solutions 72222 answers

I'm not sure how to identify a large file like that on a web server. Because YouTube chops up videos (DASH), that site shouldn't have the issue. Are there particular examples you have come across for which you can provide a URL?

I'm not sure how to identify a large file like that on a web server. Because YouTube chops up videos (DASH), that site shouldn't have the issue. Are there particular examples you have come across for which you can provide a URL?

Question owner

We are working on an intranet application.so we cannot share the url. Try to drag and drop any video file of larger size in firefox and try to play.

If not try the same for MP4 files

We are working on an intranet application.so we cannot share the url. Try to drag and drop any video file of larger size in firefox and try to play. If not try the same for MP4 files