Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash.canPlaySource always false when codecs are listed in type field #124

Closed
raycohen opened this issue Jan 12, 2012 · 3 comments
Closed

Comments

@raycohen
Copy link

"video/flv": "FLV",
"video/x-flv": "FLV",
"video/mp4": "MP4",
"video/m4v": "MP4"

 if (srcObj.type in _V_.flash.prototype.support.formats) { return "maybe"; }

a valid type field may include more than just the mimetype:

http://diveintohtml5.info/video.html

  <source src="pr6.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>

Would you accept a patch to fix this? Any thoughts on handling codecs in the type field?

@heff
Copy link
Member

heff commented Jan 12, 2012

This should and will be fixed, however browsers don't actually parse the codec info. They'll return 'probably' if you include a codec, but from testing it's clear they don't actually look at what the codec is. So it's not currently going to add any benefit.

On Jan 12, 2012, at 1:38 PM, raycohen wrote:

"video/flv": "FLV",
"video/x-flv": "FLV",
"video/mp4": "MP4",
"video/m4v": "MP4"

if (srcObj.type in _V_.flash.prototype.support.formats) { return "maybe"; }

a valid type field may include more than just the mimetype:

http://diveintohtml5.info/video.html

 <source src="pr6.mp4"  type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>

Would you accept a patch to fix this? Any thoughts on handling codecs in the type field?


Reply to this email directly or view it on GitHub:
#124

@jorrit
Copy link

jorrit commented Jan 31, 2012

I ran into this as well, my fix is:

_V_.flash.canPlaySource = function(srcObj){
  var filetype = srcObj.type;
  var semicolonPos = filetype.indexOf(';');

  if (semicolonPos != -1) {
    filetype = filetype.substring(0, semicolonPos);
  }

  if (filetype in _V_.flash.prototype.support.formats) { return "maybe"; }
};

@heff
Copy link
Member

heff commented Nov 15, 2013

This was fixed in #805

@heff heff closed this as completed Nov 15, 2013
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants