[mirotalksfu] - save init audio/video status
هذا الالتزام موجود في:
@@ -5,9 +5,16 @@ class LocalStorage {
|
||||
this.MEDIA_TYPE = {
|
||||
audio: 'audio',
|
||||
video: 'video',
|
||||
audioVideo: 'audioVideo',
|
||||
speaker: 'speaker',
|
||||
};
|
||||
|
||||
this.INIT_CONFIG = {
|
||||
audio: true,
|
||||
video: true,
|
||||
audioVideo: true,
|
||||
};
|
||||
|
||||
this.DEVICES_COUNT = {
|
||||
audio: 0,
|
||||
speaker: 0,
|
||||
@@ -33,6 +40,33 @@ class LocalStorage {
|
||||
};
|
||||
}
|
||||
|
||||
// ####################################################
|
||||
// SET LOCAL STORAGE
|
||||
// ####################################################
|
||||
|
||||
setItemLocalStorage(key, value) {
|
||||
localStorage.setItem(key, value);
|
||||
}
|
||||
|
||||
setObjectLocalStorage(name, object) {
|
||||
localStorage.setItem(name, JSON.stringify(object));
|
||||
}
|
||||
|
||||
setInitConfig(type, status) {
|
||||
switch (type) {
|
||||
case this.MEDIA_TYPE.audio:
|
||||
this.INIT_CONFIG.audio = status;
|
||||
break;
|
||||
case this.MEDIA_TYPE.video:
|
||||
this.INIT_CONFIG.video = status;
|
||||
break;
|
||||
case this.MEDIA_TYPE.audioVideo:
|
||||
this.INIT_CONFIG.audioVideo = status;
|
||||
break;
|
||||
}
|
||||
this.setObjectLocalStorage('INIT_CONFIG', this.INIT_CONFIG);
|
||||
}
|
||||
|
||||
setLocalStorageDevices(type, index, select) {
|
||||
switch (type) {
|
||||
case this.MEDIA_TYPE.audio:
|
||||
@@ -53,25 +87,25 @@ class LocalStorage {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
localStorage.setItem('LOCAL_STORAGE_DEVICES', JSON.stringify(this.LOCAL_STORAGE_DEVICES));
|
||||
this.setObjectLocalStorage('LOCAL_STORAGE_DEVICES', this.LOCAL_STORAGE_DEVICES);
|
||||
}
|
||||
|
||||
// ####################################################
|
||||
// GET LOCAL STORAGE
|
||||
// ####################################################
|
||||
|
||||
getInitConfig() {
|
||||
return this.getObjectLocalStorage('INIT_CONFIG');
|
||||
}
|
||||
|
||||
getLocalStorageDevices() {
|
||||
return JSON.parse(localStorage.getItem('LOCAL_STORAGE_DEVICES'));
|
||||
}
|
||||
|
||||
setItemLocalStorage(key, value) {
|
||||
localStorage.setItem(key, value);
|
||||
return this.getObjectLocalStorage('LOCAL_STORAGE_DEVICES');
|
||||
}
|
||||
|
||||
getItemLocalStorage(key) {
|
||||
localStorage.getItem(key);
|
||||
}
|
||||
|
||||
setObjectLocalStorage(name, object) {
|
||||
localStorage.setItem(name, JSON.stringify(object));
|
||||
}
|
||||
|
||||
getObjectLocalStorage(name) {
|
||||
return JSON.parse(localStorage.getItem(name));
|
||||
}
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم