File tree Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Expand file tree Collapse file tree 4 files changed +75
-1
lines changed Original file line number Diff line number Diff line change 66 <script src =" https://aframe.io/releases/1.0.4/aframe.min.js" ></script >
77 <script src =" https://unpkg.com/[email protected] /dist/aframe-look-at-component.min.js" ></script > 88 <script src =" https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js" ></script >
9+ <script >
10+ AFRAME .registerComponent (' audiohandler' , {
11+ init : function () {
12+ var marker = this .el ;
13+ this .vid = document .querySelector (" #vid" );
14+
15+ marker .addEventListener (' markerFound' , () => {
16+ this .toggle = true ;
17+ this .vid .play ();
18+ }.bind (this ));
19+
20+ marker .addEventListener (' markerLost' , () => {
21+ this .toggle = false ;
22+ this .vid .pause ();
23+ }.bind (this ));
24+ },
25+ });
26+ </script >
927 </head >
1028
1129 <body style =" margin: 0; overflow: hidden;" >
2139 response-type =" arraybuffer"
2240 ></a -asset-item>
2341 </a -assets>
24-
42+
2543 {{ #each assetParam.locations }}
2644 <a -entity
45+ audiohandler
2746 look-at =" [gps-camera]"
2847 id =" sound-entity"
2948 sound =" src: #sound"
Original file line number Diff line number Diff line change 66 <script src =" https://aframe.io/releases/1.0.4/aframe.min.js" ></script >
77 <script src =" https://unpkg.com/[email protected] /dist/aframe-look-at-component.min.js" ></script > 88 <script src =" https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js" ></script >
9+ <script >
10+ AFRAME .registerComponent (' videohandler' , {
11+ init : function () {
12+ var marker = this .el ;
13+ this .vid = document .querySelector (" #vid" );
14+
15+ marker .addEventListener (' markerFound' , () => {
16+ this .toggle = true ;
17+ this .vid .play ();
18+ }.bind (this ));
19+
20+ marker .addEventListener (' markerLost' , () => {
21+ this .toggle = false ;
22+ this .vid .pause ();
23+ }.bind (this ));
24+ },
25+ });
26+ </script >
927 </head >
1028
1129 <body style =" margin: 0; overflow: hidden;" >
Original file line number Diff line number Diff line change 33 <head >
44 <script src =" https://aframe.io/releases/1.0.4/aframe.min.js" ></script >
55 <script src =" https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js" ></script >
6+ <script >
7+ AFRAME .registerComponent (' audiohandler' , {
8+ init : function () {
9+ var marker = this .el ;
10+ this .vid = document .querySelector (" #vid" );
11+
12+ marker .addEventListener (' markerFound' , () => {
13+ this .toggle = true ;
14+ this .vid .play ();
15+ }.bind (this ));
16+
17+ marker .addEventListener (' markerLost' , () => {
18+ this .toggle = false ;
19+ this .vid .pause ();
20+ }.bind (this ));
21+ },
22+ });
23+ </script >
624 </head >
725
826 <body style =" margin: 0; overflow: hidden;" >
2947 ></a -marker>
3048
3149 <a -entity
50+ audiohandler
3251 id =" sound-entity"
3352 sound =" src: #sound"
3453 autoplay =" false"
Original file line number Diff line number Diff line change 55 <script src =" https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js" ></script >
66 <script src =" https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-detector.js" ></script >
77 <script src =" https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-handler.js" ></script >
8+ <script >
9+ AFRAME .registerComponent (' videohandler' , {
10+ init : function () {
11+ var marker = this .el ;
12+ this .vid = document .querySelector (" #vid" );
13+
14+ marker .addEventListener (' markerFound' , () => {
15+ this .toggle = true ;
16+ this .vid .play ();
17+ }.bind (this ));
18+
19+ marker .addEventListener (' markerLost' , () => {
20+ this .toggle = false ;
21+ this .vid .pause ();
22+ }.bind (this ));
23+ },
24+ });
25+ </script >
826 </head >
927
1028 <body style =" margin: 0; overflow: hidden;" >
You can’t perform that action at this time.
0 commit comments