Skip to content

Commit

Permalink
Merge pull request #129 from cynack/feat/want_use_ar_count
Browse files Browse the repository at this point in the history
feat: PC/MacでAR起動を試みた回数を取得
  • Loading branch information
futahei authored May 31, 2022
2 parents 67b9693 + a507da2 commit 81318e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/figni-viewer-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default class FigniViewerBaseElement extends ModelViewerElement {
// analytics data
#websocket
#arCount = 0
#wantUseArCount = 0
#hotspotClickCount = {}
#animationPlayCount = {}
#helpPageViewCount = {}
Expand Down Expand Up @@ -134,16 +135,16 @@ export default class FigniViewerBaseElement extends ModelViewerElement {
}

/**
* ARを起動する
* ARの起動を試みる
*/
activateARMode() {
tryActivateAR() {
this.#wantUseArCount++
startMesure('view-time')
if (this.canActivateAR) {
this.#arCount++
if (this.#arCount == 1) {
endMesure('initial-ar-use-time')
}
startMesure('view-time')
this.activateAR()
}
}

Expand Down Expand Up @@ -362,6 +363,7 @@ export default class FigniViewerBaseElement extends ModelViewerElement {
initial_model_view_time: this.#initialModelViewTime,
initial_interaction_time: this.#initialInteractionTime,
ar_count: this.#arCount,
want_use_ar_count: this.#wantUseArCount,
initial_ar_use_time: this.#initialArUseTime,
hotspot_click: this.#hotspotClickCount,
animation_play: this.#animationPlayCount,
Expand Down
1 change: 1 addition & 0 deletions src/figni-viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,7 @@ export default class FigniViewerElement extends HTMLElement {
}
})
this.#arButton.addEventListener('click', () => {
this.#figniViewerBase.tryActivateAR()
if (!this.#figniViewerBase.canActivateAR) {
this.#showQRCodePanel()
}
Expand Down

0 comments on commit 81318e6

Please sign in to comment.