diff --git a/package.json b/package.json index 527b304c585c8b3f71ec63cc1e779fb58317ca10..bc24c957737d5c979511498f0fcb3a0713b71abe 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "lodash": "^4.17.5", "node-sass": "^4.7.2", "prettier": "^1.7.0", - "puppeteer": "1.3.0", + "puppeteer": "1.1.0", "rimraf": "^2.6.2", "sass-loader": "^6.0.7", "selfsigned": "^1.10.2", diff --git a/scripts/run-bot.js b/scripts/run-bot.js index 4aec8fd5b066210088cbac1428767b0e8e2d60d0..d0f95d7b3b91526eb297293cbed13f3f2f8659fb 100644 --- a/scripts/run-bot.js +++ b/scripts/run-bot.js @@ -24,7 +24,7 @@ const querystring = require("query-string"); }); console.log("BPDEBUG navigated"); // Interact with the page so that audio can play. - page.mouse.click(100, 100); + await page.mouse.click(100, 100); await page.evaluate(() => { window.interacted(); }); diff --git a/scripts/run-bot.sh b/scripts/run-bot.sh index 48fcb470bd6748461d3e4bcb4ec430b7dda90c90..71e21d26dd4f31cfb061c8d20f91f3ba5b4c7b6a 100755 --- a/scripts/run-bot.sh +++ b/scripts/run-bot.sh @@ -4,8 +4,11 @@ script_directory=$(dirname "$0") script_directory=$(realpath "$script_directory") cd $script_directory/.. -yarn build -yarn serve --ssl --port 8080 public -# yarn -# yarn start & +yarn + +# yarn build +# yarn serve --ssl --port 8080 public & + +yarn start & + node scripts/run-bot.js diff --git a/src/hub.html b/src/hub.html index 942459c11044ce992de66a3e98a17e22ee3658d5..1d973e1902655946371978120a5e2ac55108f950 100644 --- a/src/hub.html +++ b/src/hub.html @@ -17,6 +17,7 @@ <% } else { %> <script src="https://cdn.rawgit.com/brianpeiris/aframe/845825ae694449524c185c44a314d361eead4680/dist/aframe-master.js"></script> <% } %> + <script>window.logs.enable("naf-janus-adapter:*")</script> </head> <body data-html-prefix="<%= HTML_PREFIX %>"> diff --git a/src/hub.js b/src/hub.js index 46e85c04cce2060eecd602f2d511b5cbe072efe0..9d809ddc4f4e4efcd7f08608c8c221e64d6948d8 100644 --- a/src/hub.js +++ b/src/hub.js @@ -306,7 +306,6 @@ const onReady = async () => { await interacted; console.log("BPDEBUG playing audio"); audio.play().catch(e => console.log(e.toString())); - NAF.connection.adapter.setLocalMediaStream(mediaStream); } if (mediaStream) { diff --git a/src/utils/ios-audio-context-fix.js b/src/utils/ios-audio-context-fix.js index ce474194f663ae81040f8fdadcdb5a5130792a37..4707a987797f782c9154c703c560cb6c946237aa 100644 --- a/src/utils/ios-audio-context-fix.js +++ b/src/utils/ios-audio-context-fix.js @@ -4,7 +4,7 @@ */ const iDevices = /\biPhone.*Mobile|\biPod|\biPad|AppleCoreMedia/; -if (iDevices.test(navigator.userAgent)) { +if (iDevices.test(navigator.userAgent) || /Chrome/.test(navigator.userAgent)) { document.addEventListener("DOMContentLoaded", () => { const ctx = THREE.AudioContext.getContext(); @@ -14,10 +14,12 @@ if (iDevices.test(navigator.userAgent)) { setTimeout(function() { if (ctx.state === "running") { document.body.removeEventListener("touchend", resume, false); + document.body.removeEventListener("mouseup", resume, false); } }, 0); } document.body.addEventListener("touchend", resume, false); + document.body.addEventListener("mouseup", resume, false); }); } diff --git a/yarn.lock b/yarn.lock index da047023a9b19545b6a90502092b7dfc14c0eff3..4370d655c31a2e6d1d050c648da9eedd12c79f73 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6756,9 +6756,9 @@ punycode@^1.2.4, punycode@^1.3.2, punycode@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" -puppeteer@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.3.0.tgz#f571c5f27153ca164a8188e6328ce2e4946878f3" +puppeteer@1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.1.0.tgz#97fbc2fbbf9ab659e7e202a68ac1ba54b8bc0a25" dependencies: debug "^2.6.8" extract-zip "^1.6.5"