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

Bug in _V_.flash.canPlaySource #219

Closed
edemaine opened this issue Aug 25, 2012 · 4 comments
Closed

Bug in _V_.flash.canPlaySource #219

edemaine opened this issue Aug 25, 2012 · 4 comments

Comments

@edemaine
Copy link
Contributor

[crossposting from Knowledge Base]

When using the Flash fallback, Video.js 3.2.0 doesn't support content types with optional codec etc. specs after a semicolon. For example, <source src="video.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> won't play despite video/mp4 being a supported format in _V_.flash.prototype.support.formats.

I fixed the bug by changing _V_.flash.canPlaySource to the following, but you might want to do it at a higher level (i.e. not Flash-specific)...

_V_.flash.canPlaySource = function(srcObj){
  var type = srcObj.type;
  if (type) {
    var i = type.indexOf (";");
    if (i >= 0)
      type = type.substr (0, i);
  }
  if (type in _V_.flash.prototype.support.formats) { return "maybe"; }
};
@mfn
Copy link

mfn commented Oct 15, 2012

Just discovered the same issue today. Interestingly, my codecs line looks exactly like yours.

@heff
Copy link
Member

heff commented May 24, 2013

Thanks for the note. This will be tracked in #124

@heff heff closed this as completed May 24, 2013
@heff
Copy link
Member

heff commented Nov 15, 2013

This was fixed in #805

@FDiskas
Copy link

FDiskas commented Nov 19, 2015

Maybe it related
TypeError: Cannot read property 'canPlaySource' of undefined

//...
      } else if (source instanceof Object) {
          // check if the source has a type and the loaded tech cannot play the source
          // if there's no type we'll just try the current tech
          if (source.type && !currentTech.canPlaySource(source)) {
            // create a source list with the current source and send through
            // the tech loop to check for a compatible technology
            this.sourceList_([source]);
          } else {
//...

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 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

4 participants