Korbs / Adding Fallback to a Custom Video Player
0 likes
0 forks
1 files
Last active 1 month ago
When building a custom video player, it will likely not work for end-users that have decided to disable JavaScript in their web browser. To get around this, it's best to add a fallback that'll allow them to switch over to the web browser's native player.
To pull this off, we'll take advantage of the HTML tag known as details and noscript.
Detect JavaScript is Disabled
First, we need to tell if JavaScript is disabled, we can use the noscript tag. Anything used within a noscript tag is shown if JavaScript is not present.
<noscript>If you're seeing this, JavaScript is not enabled.</noscript>
Newer
Older