Interfacing with JS for Chromecast

I have been playing with Bubble for less than a day and so this is a true noob question. I’ve embedded some javascript (Chromecast stuff but this would relate to anything) into a page and created a drop down box so the user can select a value that needs to be passed to the script. But I can’t figure out how to target the variable in the script or call a function.

In this snippet I have commented out the options I then put into the drop down. I need to pass the user selected one to “applicationID” in “initializeCastApi” and call “go” to trigger it. Any help is much appreciated.

   /*var applicationID = '794B7BBF'; */
   /*var applicationID = '5397EDA8'; */
   /* var applicationID = '63642DA9'; */
   /* var applicationID = '37CDE563'; */

  //var namespace = '';
  var session = null;
  /* Call initialization for Cast */
  function go() {
  if (!chrome.cast || !chrome.cast.isAvailable) {
    setTimeout(initializeCastApi, 1000);
  /* initialization */
  function initializeCastApi() {
    var sessionRequest = new chrome.cast.SessionRequest(applicationID);
    var apiConfig = new chrome.cast.ApiConfig(sessionRequest,
    chrome.cast.initialize(apiConfig, onInitSuccess, onError);

This topic was automatically closed after 70 days. New replies are no longer allowed.