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

Loaded/preloaded/autoplayed videos are uncached and time out if autoplay="false" but missing preload="auto" #3175

Open
cvan opened this issue Oct 17, 2017 · 0 comments
Labels

Comments

@cvan
Copy link
Contributor

cvan commented Oct 17, 2017

Description:

If a video is already loaded…

  1. the video loads but is not cached.

  2. an uncaught Promise is thrown (see error in the Console).
    https://github.com/aframevr/aframe/blob/68e6c26/src/core/a-assets.js#L162

  3. have mediaElementLoaded return a Promise.resolve() instead of undefined.

    Change this:

      if (!el.hasAttribute('autoplay') && el.getAttribute('preload') !== 'auto') {
        return;
      }

    to this:

      if (!el.autoplay && el.preload !== 'auto') {
        THREE.Cache.files[el.src] = el;
        return Promise.resolve();
      }

    Notice the hasAttribute and getAttribute calls have been changed to instead use the <video> element's (magical) getter properties. (I commented on this in Support <source>s in <video>s (use videoEl.src in a-assets and calculateVideoCacheHash) #3173 (comment).)

  4. Promise.all should be caught if anything throws.

/cc @machenmusik


  • A-Frame Version: 0.7.0/master
  • Platform / Device: any (but tested with iPhone 5 on iOS 10.3.1, iPhone 7 with iOS 11.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant