openvidud-ionic: multi-platform support
This commit is contained in:
parent
55eaf123a9
commit
bc956333b7
@ -29,20 +29,24 @@
|
||||
"cordova-android": "7.1.1",
|
||||
"cordova-browser": "5.0.4",
|
||||
"cordova-ios": "4.5.5",
|
||||
"cordova-plugin-android-permissions": "1.0.0",
|
||||
"cordova-plugin-device": "2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "2.1.3",
|
||||
"cordova-plugin-ionic-webview": "2.2.5",
|
||||
"cordova-plugin-iosrtc": "4.0.2",
|
||||
"cordova-plugin-splashscreen": "5.0.2",
|
||||
"cordova-plugin-statusbar": "2.4.2",
|
||||
"cordova-plugin-whitelist": "1.3.3",
|
||||
"cordova-plugin-android-permissions": "^1.0.0",
|
||||
"cordova-plugin-device": "^2.0.2",
|
||||
"cordova-plugin-ionic-keyboard": "^2.1.3",
|
||||
"cordova-plugin-ionic-webview": "^2.2.5",
|
||||
"cordova-plugin-iosrtc": "^4.0.2",
|
||||
"cordova-plugin-splashscreen": "^5.0.2",
|
||||
"cordova-plugin-statusbar": "^2.4.2",
|
||||
"cordova-plugin-whitelist": "^1.3.3",
|
||||
"core-js": "2.5.7",
|
||||
"ios-deploy": "1.9.4",
|
||||
"openvidu-browser": "2.6.0",
|
||||
"rxjs": "6.3.3",
|
||||
"xcode": "1.0.0",
|
||||
"zone.js": "0.8.26"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"ios-deploy": "1.9.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@angular-devkit/architect": "0.10.3",
|
||||
"@angular-devkit/build-angular": "0.10.3",
|
||||
|
||||
@ -54,21 +54,21 @@ export class AppComponent implements OnDestroy {
|
||||
this.platform.ready().then(() => {
|
||||
this.statusBar.styleDefault();
|
||||
this.splashScreen.hide();
|
||||
this.initializeAdapteriosRtc();
|
||||
if (this.platform.is('ios') && this.platform.is('cordova')) {
|
||||
this.initializeAdapteriosRtc();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initializeAdapteriosRtc(){
|
||||
if (this.platform.is('ios')) {
|
||||
console.warn("Initializing iosrct");
|
||||
cordova.plugins.iosrtc.registerGlobals();
|
||||
// load adapter.js (vesion 4.0.1)
|
||||
const script2 = document.createElement('script');
|
||||
script2.type = 'text/javascript';
|
||||
script2.src = 'assets/libs/adapter-4.0.1.js';
|
||||
script2.async = false;
|
||||
document.getElementsByTagName('head')[0].appendChild(script2);
|
||||
}
|
||||
initializeAdapteriosRtc() {
|
||||
console.log('Initializing iosrct');
|
||||
cordova.plugins.iosrtc.registerGlobals();
|
||||
// load adapter.js (vesion 4.0.1)
|
||||
const script2 = document.createElement('script');
|
||||
script2.type = 'text/javascript';
|
||||
script2.src = 'assets/libs/adapter-4.0.1.js';
|
||||
script2.async = false;
|
||||
document.getElementsByTagName('head')[0].appendChild(script2);
|
||||
}
|
||||
|
||||
@HostListener('window:beforeunload')
|
||||
@ -118,14 +118,17 @@ export class AppComponent implements OnDestroy {
|
||||
.connect(token, { clientData: this.myUserName })
|
||||
.then(() => {
|
||||
// --- 5) Requesting and Checking Android Permissions
|
||||
if (this.platform.is('android')) {
|
||||
console.log("Android platform");
|
||||
this.checkAndroidPermissions()
|
||||
.then(() => this.initPublisher())
|
||||
.catch((err) => console.error(err));
|
||||
} else if (this.platform.is('ios')){
|
||||
console.log("iOS platform");
|
||||
this.initPublisher();
|
||||
if (this.platform.is('cordova')) {
|
||||
// Ionic platform
|
||||
if (this.platform.is('android')) {
|
||||
console.log('Android platform');
|
||||
this.checkAndroidPermissions()
|
||||
.then(() => this.initPublisher())
|
||||
.catch((err) => console.error(err));
|
||||
} else if (this.platform.is('ios')) {
|
||||
console.log('iOS platform');
|
||||
this.initPublisher();
|
||||
}
|
||||
} else {
|
||||
this.initPublisher();
|
||||
}
|
||||
@ -151,7 +154,7 @@ export class AppComponent implements OnDestroy {
|
||||
if (this.platform.is('ios')) {
|
||||
cordova.plugins.iosrtc.observeVideo(this.pVideo);
|
||||
}
|
||||
});
|
||||
});
|
||||
}*/
|
||||
|
||||
initPublisher() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user