Ionic + chromecast


#1

Im trying to connect a chromecast with my ionic app.

In the browser the code below works fine, but when I run with “ionic run android”, isAvailable returns false always.

<script type="text/javascript">
  window['__onGCastApiAvailable'] = function(isAvailable) {
        var options = {};
        options.receiverApplicationId = chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID;
        options.autoJoinPolicy = chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED;
        cast.framework.CastContext.getInstance().setOptions(options);
      }
  };
</script>
<script type="text/javascript" src="https://www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1"></script>

Any ideas?


#2

I have similar issue any update please