Skip to content

Commit bbd27c7

Browse files
authored
Use proper THREE.Cache API in a-assets.js (#4864)
1 parent 4decfa0 commit bbd27c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/core/a-assets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module.exports = registerElement('a-assets', {
4242
loaded.push(new Promise(function (resolve, reject) {
4343
// Set in cache because we won't be needing to call three.js loader if we have.
4444
// a loaded media element.
45-
THREE.Cache.files[imgEls[i].getAttribute('src')] = imgEl;
45+
THREE.Cache.add(imgEls[i].getAttribute('src'), imgEl);
4646
imgEl.onload = resolve;
4747
imgEl.onerror = reject;
4848
}));
@@ -165,7 +165,7 @@ function mediaElementLoaded (el) {
165165
// Store video elements only. three.js loader is used for audio elements.
166166
// See assetParse too.
167167
if (el.tagName === 'VIDEO') {
168-
THREE.Cache.files[el.getAttribute('src')] = el;
168+
THREE.Cache.add(el.getAttribute('src'), el);
169169
}
170170
resolve();
171171
}

0 commit comments

Comments
 (0)