Skip to content

Commit c4554aa

Browse files
takahiroxngokevin
authored andcommitted
Bump Three.js to r83 (aframevr#2214)
1 parent cf89cdb commit c4554aa

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"present": "0.0.6",
3838
"promise-polyfill": "^3.1.0",
3939
"style-attr": "^1.0.2",
40-
"three": "^0.82.1",
40+
"three": "^0.83.0",
4141
"tween.js": "^15.0.0",
4242
"webvr-polyfill": "^0.9.23"
4343
},

‎src/components/sound.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ module.exports.Component = registerComponent('sound', {
134134
el.setObject3D(this.attrName, this.pool);
135135

136136
this.pool.children.forEach(function (sound) {
137-
sound.source.onended = function () {
138-
sound.onEnded();
137+
sound.onEnded = function () {
138+
sound.isPlaying = false;
139139
el.emit('sound-ended', {index: i});
140140
};
141141
});
@@ -146,7 +146,7 @@ module.exports.Component = registerComponent('sound', {
146146
*/
147147
pauseSound: function () {
148148
this.pool.children.forEach(function (sound) {
149-
if (!sound.source.buffer || !sound.isPlaying || !sound.pause) { return; }
149+
if (!sound.source || !sound.source.buffer || !sound.isPlaying || !sound.pause) { return; }
150150
sound.pause();
151151
});
152152
},
@@ -157,7 +157,7 @@ module.exports.Component = registerComponent('sound', {
157157
playSound: function () {
158158
var found = false;
159159
this.pool.children.forEach(function (sound) {
160-
if (!sound.isPlaying && sound.source.buffer && !found) {
160+
if (!sound.isPlaying && sound.buffer && !found) {
161161
sound.play();
162162
found = true;
163163
return;
@@ -175,7 +175,7 @@ module.exports.Component = registerComponent('sound', {
175175
*/
176176
stopSound: function () {
177177
this.pool.children.forEach(function (sound) {
178-
if (!sound.source.buffer) { return; }
178+
if (!sound.source || !sound.source.buffer) { return; }
179179
sound.stop();
180180
});
181181
}

‎src/core/a-assets.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var debug = require('../utils/debug');
44
var registerElement = require('./a-register-element').registerElement;
55
var THREE = require('../lib/three');
66

7-
var fileLoader = new THREE.XHRLoader();
7+
var fileLoader = new THREE.FileLoader();
88
var warn = debug('core:a-assets:warn');
99

1010
/**

‎tests/components/sound.test.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ suite('sound', function () {
6666
disconnect: sinon.stub(),
6767
pause: sinon.stub(),
6868
isPlaying: false,
69+
buffer: true,
6970
source: {buffer: true}
7071
};
7172
el.pause();
@@ -78,6 +79,7 @@ suite('sound', function () {
7879
disconnect: sinon.stub(),
7980
pause: sinon.stub(),
8081
isPlaying: true,
82+
buffer: true,
8183
source: {buffer: true}
8284
};
8385
el.components.sound.isPlaying = true;
@@ -93,6 +95,7 @@ suite('sound', function () {
9395
disconnect: sinon.stub(),
9496
play: sinon.stub(),
9597
isPlaying: false,
98+
buffer: true,
9699
source: {buffer: true}
97100
};
98101
el.components.sound.autoplay = true;
@@ -108,6 +111,7 @@ suite('sound', function () {
108111
disconnect: sinon.stub(),
109112
isPlaying: true,
110113
pause: sinon.stub(),
114+
buffer: true,
111115
source: {buffer: true}
112116
};
113117
el.components.sound.pauseSound();
@@ -122,6 +126,7 @@ suite('sound', function () {
122126
disconnect: sinon.stub(),
123127
play: sinon.stub(),
124128
isPlaying: false,
129+
buffer: true,
125130
source: {buffer: true}
126131
};
127132
el.components.sound.playSound();
@@ -136,6 +141,7 @@ suite('sound', function () {
136141
disconnect: sinon.stub(),
137142
isPlaying: true,
138143
stop: sinon.stub(),
144+
buffer: true,
139145
source: {buffer: true}
140146
};
141147
el.components.sound.stopSound();

0 commit comments

Comments
 (0)