Giter Site home page Giter Site logo

Comments (3)

LoneCoder21 avatar LoneCoder21 commented on June 19, 2024 1

Oh i see. I had this issue in my extension too so I'll just use this option 😞

from jumpcutter.

LoneCoder21 avatar LoneCoder21 commented on June 19, 2024

wait how did u detect the likelihood of media being unsupported?

from jumpcutter.

WofWca avatar WofWca commented on June 19, 2024

@LoneCoder21

It's this check

return elCurrentSrcUrl.origin !== document.location.origin;

See the comment:

function getAppropriateControllerType(
settings: Pick<Settings, typeof controllerTypeDependsOnSettings[number]>,
elementSourceIsCrossOrigin: boolean,
): ControllerKind {
// Analyzing audio data of a CORS-restricted media element is impossible because its
// `MediaElementAudioSourceNode` outputs silence (see
// https://webaudio.github.io/web-audio-api/#MediaElementAudioSourceOptions-security,
// https://github.com/WofWca/jumpcutter/issues/47,
// https://html.spec.whatwg.org/multipage/media.html#security-and-privacy-considerations),
// so it's not that we only are unable to analyze it - the user also becomes unable to hear its sound.
// The following is to avoid that.
//
// Actually, the fact that a source is cross-origin doesn't guarantee that `MediaElementAudioSourceNode`
// will output silence. For example, if the media data is served with `Access-Control-Allow-Origin`
// header set to `document.location.origin`. But currently it's not easy to detect that. See
// https://github.com/WebAudio/web-audio-api/issues/2453.
// It's better to not attach to an element than to risk muting it as it's more confusing to the user.
return elementSourceIsCrossOrigin && settings.dontAttachToCrossOriginMedia
? ControllerKind.ALWAYS_SOUNDED
: settings.experimentalControllerType

So it's not like we detect an actual likelihood expressed as a number between 0 and 100%, but rather "it's cross-origin, so it's probably not gonna work".

from jumpcutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.