Git Product home page Git Product logo

video-unmute's Introduction

videojs-unmute

Video.js plugin to mute automatically a video in autoplay mode and will add a Unmute button like Youtube when a video is set to autoplay

CDN for JS and CSS files: (may be temporary - include the js file after videojs javascript file)

<link href="https://cdn.jsdelivr.net/gh/onigetoc/videojs-unmute@main/dist/videojs-unmute.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/gh/onigetoc/videojs-unmute@main/dist/videojs-unmute.min.js"></script>

Latest version

<script src="https://cdn.jsdelivr.net/gh/onigetoc/[email protected]/dist/videojs-unmute.js</script>

Basic Usage

Call the plugin:

const myPlayer = videojs("myvideoID");
// Call the plugin
myPlayer.unmuteButton();  

The button is just a suggestion since you can click anywhere on the video to unmute.

Visual demo

View demo

Simple demo on Codepen

https://codepen.io/onigetoc/full/WNJLEJj

Complex demo with jQuery on Codepen

https://codepen.io/onigetoc/full/VwxRVYj

Githack preview: https://raw.githack.com/onigetoc/videojs-unmute/main/index.html

Description

Video.js plugin to mute automatically a video in autoplay mode and will add a Unmute button like Youtube when a video is set to autoplay. Cross-compatibility for Video.js 5 and 6.

Languages

Translate to 11 of the most spoken languages in the world

translate={"en":"UNMUTE","zh":"激活声音","hi":"ध्वनि सक्रिय करें","es":"ACTIVAR SONIDO","fr":"ACTIVER LE SON","ar":"تنشيط الصوت","bn":"নিঃশব্দ","ru":"ВКЛЮЧИТЬ ЗВУК","pt":"ATIVAR SOM","de":"TON AKTIVIEREN","id":"AKTIFKAN SUARA"};  

Overwrite css

.vjs-unmute-overlay {} /* Overlay transparent 100% height and width of the video size */
.vjs-unmute {} /*Unmute button*/
.vjs-unmute:before {} /* Videojs muted icon */
.vjs-wrapper {} /* the wrapper div added around the video */

See the CSS file

To do

  • Add language from browser language
  • include css from the js file (may work in the next hours) (Problem with :before style may just use normal .css file)
  • Make it work from npm

Help & suggestions

If there's a request for help or to add options create a new issue.

video-unmute's People

Contributors

onigetoc avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.