Last active
April 26, 2024 22:10
-
-
Save freaktechnik/8bd895b49812faddd0033532ce7999f3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <select id="resolution"> | |
| <option value="1080p60" label="1080p 60FPS"> | |
| <option value="720p" label ="720p 30FPS"> | |
| <option value="mp3" label="Audio only (mp3)"> | |
| </select> | |
| <script src="index.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const valueMap = { | |
| "1080p60": { | |
| res: "1080p60", | |
| type: "video" | |
| }, | |
| "720p": { | |
| res: "720p30", | |
| type: "video" | |
| }, | |
| "mp3": { | |
| res: "", | |
| type: "audio" | |
| } | |
| }; | |
| document.getElementById("resolution").addEventListener("change", function(e) { | |
| const details = valueMap[this.value]; | |
| /* If "1080p60" is selected, details will be | |
| * { | |
| * "res": "1080p60", | |
| * "type": "video" | |
| * } | |
| */ | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment