fixed nacl plugin not responding

This commit is contained in:
Aidan Campbell 2016-02-16 15:00:53 -05:00
parent f96bd0546f
commit 9ee00e7db0
2 changed files with 6 additions and 7 deletions

View File

@ -60,9 +60,8 @@
<button id="quitGameButton">Quit Current Game</button> <button id="quitGameButton">Quit Current Game</button>
</div> </div>
<!-- The NaCl plugin will be embedded inside the element with id "listener". <div id="listener">
See common.js. --> </div>
<div id="listener"></div>
</main> </main>
</div> </div>
<script defer src="static/js/jquery-2.2.0.min.js"></script> <script defer src="static/js/jquery-2.2.0.min.js"></script>

View File

@ -7,7 +7,6 @@ function attachListeners() {
} }
function moduleDidLoad() { function moduleDidLoad() {
common.naclModule = document.getElementById('nacl_module');
var logEl = document.getElementById('logField'); var logEl = document.getElementById('logField');
logEl.innerHTML = "module loaded"; logEl.innerHTML = "module loaded";
} }
@ -19,7 +18,7 @@ function hideAllWorkflowDivs() {
document.getElementById('streamSettings').style.display = 'inline-block'; document.getElementById('streamSettings').style.display = 'inline-block';
document.getElementById('hostSettings').style.display = 'inline-block'; document.getElementById('hostSettings').style.display = 'inline-block';
document.getElementById('gameSelection').style.display = 'none'; document.getElementById('gameSelection').style.display = 'none';
document.getElementById('listener').style.display = 'none'; common.hideModule(); // do NOT hide the nacl module. you can't interact with it then
} }
// pair button was pushed. pass what the user entered into the GFEHostIPField. // pair button was pushed. pass what the user entered into the GFEHostIPField.
@ -46,7 +45,7 @@ function showAppsMode() {
document.getElementById('streamSettings').style.display = 'none'; document.getElementById('streamSettings').style.display = 'none';
document.getElementById('hostSettings').style.display = 'none' document.getElementById('hostSettings').style.display = 'none'
document.getElementById('gameSelection').style.display = 'inline-block' document.getElementById('gameSelection').style.display = 'inline-block'
document.getElementById('listener').style.display = 'none' common.hideModule(); // do NOT hide the nacl module. you can't interact with it then
} }
// user wants to start a stream. We need the host, game ID, and video settings(?) // user wants to start a stream. We need the host, game ID, and video settings(?)
@ -59,6 +58,7 @@ function startPushed() {
} }
var gameIDDropdown = document.getElementById("selectGame"); var gameIDDropdown = document.getElementById("selectGame");
var gameID = gameIDDropdown[gameIDDropdown.selectedIndex].value; var gameID = gameIDDropdown[gameIDDropdown.selectedIndex].value;
console.log(common.naclModule);
common.naclModule.postMessage('setGFEHostIPField:' + target + ":" + gameID); common.naclModule.postMessage('setGFEHostIPField:' + target + ":" + gameID);
// we just finished the gameSelection section. only expose the NaCl section // we just finished the gameSelection section. only expose the NaCl section
playGameMode(); playGameMode();
@ -66,7 +66,7 @@ function startPushed() {
function playGameMode() { function playGameMode() {
$("body").children().not("#listener").hide(); $("body").children().not("#listener").hide();
$("body").addClass("fullscreen"); $("body").addClass("fullscreen")
} }
// user pushed the stop button. we should stop. // user pushed the stop button. we should stop.