]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/assets/player/utils.ts
Add theatre mode
[github/Chocobozzz/PeerTube.git] / client / src / assets / player / utils.ts
index 4eaf537209022d96770fe6f601a60de8ee79bb3b..b7cd40aa28e9155577ed49b1f270e1f3b92a33ec 100644 (file)
@@ -51,6 +51,13 @@ function getAverageBandwidth () {
   return undefined
 }
 
+function getStoredTheater () {
+  const value = getLocalStorage('theater-enabled')
+  if (value !== null && value !== undefined) return value === 'true'
+
+  return undefined
+}
+
 function saveVolumeInStore (value: number) {
   return setLocalStorage('volume', value.toString())
 }
@@ -59,6 +66,10 @@ function saveMuteInStore (value: boolean) {
   return setLocalStorage('mute', value.toString())
 }
 
+function saveTheaterInStore (enabled: boolean) {
+  return setLocalStorage('theater-enabled', enabled.toString())
+}
+
 function saveAverageBandwidth (value: number) {
   return setLocalStorage('average-bandwidth', value.toString())
 }
@@ -133,6 +144,8 @@ export {
   videoFileMaxByResolution,
   videoFileMinByResolution,
   copyToClipboard,
+  getStoredTheater,
+  saveTheaterInStore,
   isMobile,
   bytes
 }