add volume

This commit is contained in:
Harvey Zack committed 2018-10-23 13:21:39 +08:00
1 parent dfd71c06b6
commit c69c3a42ed
14 files changed
+157 -38

No files matched your search

+12
View File
@@ -79,3 +79,15 @@ export function deepMerge(...sources) {
}
return returnValue;
}
export function getStorage(key) {
const storage = JSON.parse(localStorage.getItem('artplayer_settings')) || {};
return key ? storage[key] : storage;
}
export function setStorage(key, value) {
const storage = Object.assign({}, getStorage(), {
[key]: value
});
localStorage.setItem('artplayer_settings', JSON.stringify(storage));
}