GithubHelp home page GithubHelp logo

Add Autohide about videogular2 HOT 3 CLOSED

videogular avatar videogular commented on May 18, 2024
Add Autohide

from videogular2.

Comments (3)

manekinekko avatar manekinekko commented on May 18, 2024

I can take this one :)

from videogular2.

Elecash avatar Elecash commented on May 18, 2024

👍

from videogular2.

Elecash avatar Elecash commented on May 18, 2024

I'm reopening this to change a few things on this feature that maybe I didn't clarify on first description.

Videogular works with a plugin system (modules at the end) that are added and removed by HTML tags. Each plugin to interact with the media elements inside Videogular (video and audio tags inside vg-player tag) need to use an external API (VgAPI).

That means that VgPlayer and VgControls can't know the existence of each other and that's why we can't have references to other plugins (modules) inside vg-player. Like here:
https://github.com/videogular/videogular2/blob/master/src/vg-player/vg-player.ts#L75-L81

To deal with this, I suggest to add a reference to the Videogular element inside VgAPI and each plugin must subscribe to element events individually.

For example:

    ngOnInit() {
      var mouseEnter = Observable.fromEvent(this.api.videogularElement, 'mouseenter');
      mouseEnter.subscribe(this.show.bind(this));

      var mouseLeave = Observable.fromEvent(this.api.videogularElement, 'mouseleave');
      mouseLeave.subscribe(this.hide.bind(this));
    }

from videogular2.

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.