All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists matching topic fallback

Recently created
Least recently created
Recently updated
Least recently updated
Korbs's Avatar

Korbs / Adding Fallback to a Custom Video Player

0 likes
0 forks
1 files
Last active 1 month ago
fallback javascript

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

Powered by Opengist ⋅ Load: 13ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ Privacy Policy