Difference Between Local & Session Storage and Audio Video
Local storage retains data even after the browser is closed and is shared across all tabs, while session storage only retains data for the duration of a tab's open session. The <audio> tag is designed for sound files, whereas the <video> tag is for video files and includes visual display capabilities. Both storage types and HTML tags have distinct use cases, accessibility, and security features.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
4 views2 pages
Difference Between Local & Session Storage and Audio Video
Local storage retains data even after the browser is closed and is shared across all tabs, while session storage only retains data for the duration of a tab's open session. The <audio> tag is designed for sound files, whereas the <video> tag is for video files and includes visual display capabilities. Both storage types and HTML tags have distinct use cases, accessibility, and security features.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2
Difference between local storage and session storage
Feature Local Storage Session Storage
Data persists even after the browser Data is cleared once the browser tab 1. Lifespan is closed. is closed. Shared across all tabs and windows Available only to the tab or window 2. Scope of the same origin. where it was set. Typically allows up to 5–10 MB of 3. Storage Limit Usually allows about 5 MB of data. data. Ideal for long-term storage (e.g., Best for temporary data (e.g., one- 4. Use Case user preferences). time forms). Accessible by all scripts on the Accessible by scripts only in the 5. Accessibility same origin. active session. Data does not expire unless Data automatically expires on 6. Expiry manually removed. tab/browser close. Saving theme preferences or login Storing form input or quiz answers 7. Example Use tokens. during a session. 8. Developer localStorage.setItem("key", "value") sessionStorage.setItem("key", "value") Console Key Slightly less secure, as data lingers More secure for short-lived, 9. Security longer. sensitive data. 10. Persistence Yes – even after system reboot. No – once tab is closed, data is gone. Across Sessions Difference between 🎧 <audio> vs 🎥 <video> in HTML5 Feature <audio> Tag <video> Tag 1. Purpose Plays sound/audio files. Plays video files (with or without audio). 2. Media Type Only supports audio formats. Supports video and audio formats. 3. Visual Shows only controls (no visual Displays video screen and controls. Display content). <audio src="song.mp3" <video src="movie.mp4" 4. Tag Syntax controls></audio> controls></video> 5. File Size Usually smaller file sizes. Usually larger file sizes. Background music, podcasts, 6. Use Case Tutorials, movies, user-generated content. sound effects. 7. Common File .mp3, .ogg, .wav .mp4, .webm, .ogg Types 8. Poster ✅ Supports poster to show a thumbnail ❌ Not applicable Attribute before play 9. Subtitles & ✅ Supports <track> for ❌ No subtitle support Captions captions/subtitles 10. Controls Adds audio controls like Adds full media controls like play, pause, Attribute play/pause volume, fullscreen