showCastDialog static method

Future<void> showCastDialog()

Implementation

static Future<void> showCastDialog() async {
  _eval('''
    if (window.isChromecastSdkReady) {
      cast.framework.CastContext.getInstance().requestSession()
        .then(function() { console.log('Sessie succesvol gestart!'); })
        .catch(function(err) { console.log('Cast popup gesloten of fout: ' + err); });
    } else {
      alert('Google Cast SDK is nog niet gereed in Chrome. Controleer je wifi-verbinding.');
    }
  ''');
}