MCPcopy Create free account
hub / github.com/error311/FileRise / loadSavedMediaVolume

Function loadSavedMediaVolume

public/js/filePreview.js:79–96  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

77const MEDIA_MUTED_KEY = 'frMediaMuted';
78
79function loadSavedMediaVolume(el) {
80 if (!el) return;
81 try {
82 const v = localStorage.getItem(MEDIA_VOLUME_KEY);
83 if (v !== null) {
84 const vol = parseFloat(v);
85 if (!Number.isNaN(vol)) {
86 el.volume = Math.max(0, Math.min(1, vol));
87 }
88 }
89 const m = localStorage.getItem(MEDIA_MUTED_KEY);
90 if (m !== null) {
91 el.muted = (m === '1');
92 }
93 } catch (e) {
94 // ignore storage errors
95 }
96}
97
98function attachVolumePersistence(el) {
99 if (!el) return;

Callers 1

previewFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected