openvidu-ionic: Fixed video bug and removed adapter.js
This commit is contained in:
parent
c7cca00142
commit
d6fbf4b5ca
@ -52,22 +52,11 @@ export class AppComponent implements OnDestroy {
|
||||
this.statusBar.styleDefault();
|
||||
this.splashScreen.hide();
|
||||
if (this.platform.is('ios') && this.platform.is('cordova')) {
|
||||
this.initializeAdapterIosRtc();
|
||||
cordova.plugins.iosrtc.registerGlobals();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initializeAdapterIosRtc() {
|
||||
console.log('Initializing iosrct');
|
||||
cordova.plugins.iosrtc.registerGlobals();
|
||||
// load adapter.js (version 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.head.appendChild(script2);
|
||||
}
|
||||
|
||||
@HostListener('window:beforeunload')
|
||||
beforeunloadHandler() {
|
||||
// On window closed leave session
|
||||
|
||||
@ -20,11 +20,10 @@ export class OpenViduVideoComponent implements AfterViewInit, OnDestroy {
|
||||
if (this.isIos() && this._streamManager.remote) {
|
||||
this.rotationFunction = () => {
|
||||
// Give the remote video some time to update its dimensions when rotating the device
|
||||
setTimeout(() => {
|
||||
this.applyIosIonicVideoAttributes();
|
||||
}, 250);
|
||||
this.applyIosAttributes();
|
||||
};
|
||||
(<any>window).addEventListener('orientationchange', this.rotationFunction);
|
||||
this.applyIosAttributes();
|
||||
}
|
||||
this.updateVideoView();
|
||||
}
|
||||
@ -73,4 +72,10 @@ export class OpenViduVideoComponent implements AfterViewInit, OnDestroy {
|
||||
private isIos(): boolean {
|
||||
return this.platform.is('ios') && this.platform.is('cordova');
|
||||
}
|
||||
|
||||
private applyIosAttributes(){
|
||||
setTimeout(() => {
|
||||
this.applyIosIonicVideoAttributes();
|
||||
}, 250);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user