Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Hubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ar-noc
Hubs
Commits
22b1c6d5
Commit
22b1c6d5
authored
6 years ago
by
Robert Long
Browse files
Options
Downloads
Patches
Plain Diff
Remove a-progressive-asset
parent
b3d1cac5
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/avatar-selector.js
+0
-1
0 additions, 1 deletion
src/avatar-selector.js
src/elements/a-progressive-asset.js
+0
-67
0 additions, 67 deletions
src/elements/a-progressive-asset.js
src/hub.js
+0
-2
0 additions, 2 deletions
src/hub.js
webpack.config.js
+1
-8
1 addition, 8 deletions
webpack.config.js
with
1 addition
and
78 deletions
src/avatar-selector.js
+
0
−
1
View file @
22b1c6d5
...
...
@@ -10,7 +10,6 @@ import "./vendor/GLTFLoader";
import
"
./components/animation-mixer
"
;
import
"
./components/audio-feedback
"
;
import
"
./components/loop-animation
"
;
import
"
./elements/a-progressive-asset
"
;
import
"
./gltf-component-mappings
"
;
import
{
avatars
}
from
"
./assets/avatars/avatars
"
;
...
...
This diff is collapsed.
Click to expand it.
src/elements/a-progressive-asset.js
deleted
100644 → 0
+
0
−
67
View file @
b3d1cac5
/**
* Modified version of a-asset-item that adds high-src and low-src options
* Extracted from https://github.com/aframevr/aframe/blob/master/src/core/a-assets.js
*/
AFRAME
.
registerElement
(
"
a-progressive-asset
"
,
{
prototype
:
Object
.
create
(
AFRAME
.
ANode
.
prototype
,
{
createdCallback
:
{
value
()
{
this
.
data
=
null
;
this
.
isAssetItem
=
true
;
}
},
attachedCallback
:
{
value
()
{
if
(
!
this
.
parentNode
.
fileLoader
)
{
throw
new
Error
(
"
a-progressive-asset must be the child of an a-assets element.
"
);
}
this
.
fileLoader
=
this
.
parentNode
.
fileLoader
;
const
self
=
this
;
const
fallbackSrc
=
this
.
getAttribute
(
"
src
"
);
const
highSrc
=
this
.
getAttribute
(
"
high-src
"
);
const
lowSrc
=
this
.
getAttribute
(
"
low-src
"
);
let
src
=
fallbackSrc
;
if
(
window
.
APP
.
quality
===
"
high
"
)
{
src
=
highSrc
;
}
else
if
(
window
.
APP
.
quality
===
"
low
"
)
{
src
=
lowSrc
;
}
this
.
fileLoader
.
setResponseType
(
this
.
getAttribute
(
"
response-type
"
));
this
.
fileLoader
.
load
(
src
,
function
handleOnLoad
(
response
)
{
self
.
data
=
response
;
/*
Workaround for a Chrome bug. If another XHR is sent to the same url before the
previous one closes, the second request never finishes.
setTimeout finishes the first request and lets the logic triggered by load open
subsequent requests.
setTimeout can be removed once the fix for the bug below ships:
https://bugs.chromium.org/p/chromium/issues/detail?id=633696&q=component%3ABlink%3ENetwork%3EXHR%20&colspec=ID%20Pri%20M%20Stars%20ReleaseBlock%20Component%20Status%20Owner%20Summary%20OS%20Modified
*/
setTimeout
(
function
load
()
{
AFRAME
.
ANode
.
prototype
.
load
.
call
(
self
);
});
},
function
handleOnProgress
(
xhr
)
{
self
.
emit
(
"
progress
"
,
{
loadedBytes
:
xhr
.
loaded
,
totalBytes
:
xhr
.
total
,
xhr
:
xhr
});
},
function
handleOnError
(
xhr
)
{
self
.
emit
(
"
error
"
,
{
xhr
:
xhr
});
}
);
}
}
})
});
This diff is collapsed.
Click to expand it.
src/hub.js
+
0
−
2
View file @
22b1c6d5
...
...
@@ -66,8 +66,6 @@ if (qs.quality) {
window
.
APP
.
quality
=
isMobile
?
"
low
"
:
"
high
"
;
}
import
"
./elements/a-progressive-asset
"
;
import
"
aframe-physics-system
"
;
import
"
aframe-physics-extras
"
;
import
"
super-hands
"
;
...
...
This diff is collapsed.
Click to expand it.
webpack.config.js
+
1
−
8
View file @
22b1c6d5
...
...
@@ -118,14 +118,7 @@ const config = {
loader
:
"
html-loader
"
,
options
:
{
// <a-asset-item>'s src property is overwritten with the correct transformed asset url.
attrs
:
[
"
img:src
"
,
"
a-asset-item:src
"
,
"
a-progressive-asset:src
"
,
"
a-progressive-asset:high-src
"
,
"
a-progressive-asset:low-src
"
,
"
audio:src
"
],
attrs
:
[
"
img:src
"
,
"
a-asset-item:src
"
,
"
audio:src
"
],
// You can get transformed asset urls in an html template using ${require("pathToFile.ext")}
interpolate
:
"
require
"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment