2020-03-21 18:14:08 +01:00
|
|
|
define([], function() {
|
|
|
|
'use strict';
|
|
|
|
|
2020-05-04 12:44:12 +02:00
|
|
|
if (window.appMode === 'cordova' || window.appMode === 'android') {
|
2020-03-21 18:14:08 +01:00
|
|
|
return {
|
|
|
|
load: function () {
|
|
|
|
window.chrome = window.chrome || {};
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
var ccLoaded = false;
|
|
|
|
return {
|
|
|
|
load: function () {
|
|
|
|
if (ccLoaded) {
|
|
|
|
return Promise.resolve();
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
2020-05-04 12:44:12 +02:00
|
|
|
var fileref = document.createElement('script');
|
|
|
|
fileref.setAttribute('type', 'text/javascript');
|
2020-03-21 18:14:08 +01:00
|
|
|
|
|
|
|
fileref.onload = function () {
|
|
|
|
ccLoaded = true;
|
|
|
|
resolve();
|
|
|
|
};
|
|
|
|
|
2020-05-04 12:44:12 +02:00
|
|
|
fileref.setAttribute('src', 'https://www.gstatic.com/cv/js/sender/v1/cast_sender.js');
|
|
|
|
document.querySelector('head').appendChild(fileref);
|
2020-03-21 18:14:08 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
});
|