Giter VIP home page Giter VIP logo

Comments (4)

aitoraznar avatar aitoraznar commented on June 10, 2024

You can do it yourself with Custom Hotkeys.
Explained in this section https://github.com/ctd1500/videojs-hotkeys#custom-hotkeys-and-overrides

from videojs-hotkeys.

surikat1978 avatar surikat1978 commented on June 10, 2024

Unfortunately there is nothing said about using the keys - + for increase , decrease, captions ?
it was very useful to do by default !

from videojs-hotkeys.

aitoraznar avatar aitoraznar commented on June 10, 2024

@surikat1978
I suggested the use of Custom keys to create your own shortkey.
I made a basic example (of increase font size) to illustrate you, I haven't tried, it's only to guide you.

videojs('vidId').ready(function() {
  this.hotkeys({
    volumeStep: 0.1,
    customKeys: {
      // Create custom hotkeys
      increaseCaptionSize: {
        key: function(event) {
          //107: Plus key
          //171: Numeric plus key
          return (event.which === 107 || event.which === 171);
        },
        handler: function(player, options, event) {
          //player.muted(!player.muted());
          //Here increase the size using CSS classes, directly in a style tag... it is up to you
          videojs('veoplayer_html5_api').textTrackDisplay.el().style['font-size'] = '50px'
        }
      }
    }
  });
});

from videojs-hotkeys.

surikat1978 avatar surikat1978 commented on June 10, 2024

I have a plugin initialization file libs.js in my template:

$(document).ready(function() {
videojs('testvideo').ready(function() {
this.hotkeys({
volumeStep: 0.1,
seekStep: 5,
enableMute: true,
enableVolumeScroll: true,
enableFullscreen: true,
enableNumbers: true,

	});  
});

});

added this kind of

$(document).ready(function() {
videojs('testvideo').ready(function() {
this.hotkeys({
volumeStep: 0.1,
seekStep: 5,
enableMute: true,
enableVolumeScroll: true,
enableFullscreen: true,
enableNumbers: true,
customKeys: {
// Create custom hotkeys
increaseCaptionSize: {
key: function(event) {
//107: Plus key
//171: Numeric plus key
return (event.which === 107 || event.which === 171);
},
handler: function(player, options, event) {
//player.muted(!player.muted());
//Here increase the size using CSS classes, directly in a style tag... it is up to you
videojs('veoplayer_html5_api').textTrackDisplay.el().style['font-size'] = '50px'
}
}
}
});
});

And stopped showing subtitles and control of player ?!
Maybe need to add something to the videojs.hotkeys.min.js ? Version 2.0.18

Thanks Very Much !

from videojs-hotkeys.

Related Issues (20)

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.