mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
406 stars 138 forks source link

Control bar show event #40

Closed lebanggit closed 7 years ago

lebanggit commented 7 years ago

I having try develop a plugin with simple download button. It will embed on top-right corner of mejs player.

I will show/hide when user hover to player (like control bar).

Please add event of this.

jimmywarting commented 7 years ago

Why not add it to the media bar at the bottom?

lebanggit commented 7 years ago

All Feature icons on media bar.... Very tangled

rafa8626 commented 7 years ago

@lebanggit This event exists already, but it must be attached to the media's container element:

new MediaElementPlayer('player1', {
     // Your configuration
    success: function (media) {
        media.closest('.mejs__container').addEventListener('controlsshown', function() {
               // Your code when control bar is being displayed...
        });

        media.closest('.mejs__container').addEventListener('controlshidden', function() {
               // Your code when control bar is being hidden...
        });
    }
});

Let me know if it works for you

rafa8626 commented 7 years ago
buildXXXX: function (player, controls, layer, media) {
       player.container.addEventListener('controlsshown', function() {
              // your code...
       });
}

Let me know if that works for you. Also, Please star us at https://github.com/mediaelement/mediaelement and https://github.com/mediaelement/mediaelement-plugins to continue improving the package and giving it more popularity; also tell your friends/coworkers/etc. to support the project, if you don't mind.It would be greatly appreciated it

lebanggit commented 7 years ago

Great!!! Success. But this button just working after media playing....

@rafa8626 : You should add a top bar controls container like media controls.

It contain share, download, report button..... and title of video

lebanggit commented 7 years ago

mejsoverlay mejslayer mejs__overlay-play

Is top layer and width 100%, height 100%.

When media stop, all control behind not woking.

rafa8626 commented 7 years ago

You might want to include the alwaysShowControls: true configuration; see if that works for you

lebanggit commented 7 years ago

Not working..

Maybe set height of mejs__overlay-play

rafa8626 commented 7 years ago

If you can share the URL so I can take a look I'd appreciate it

lebanggit commented 7 years ago

http://demo.lebang.vn/embed.html

Focus the Download button

rafa8626 commented 7 years ago

Just set mejs__top_controls class z-index to 5, and that should do it

screen shot 2017-05-08 at 12 45 24 pm
lebanggit commented 7 years ago

Wow..... great.... resolved

rafa8626 commented 7 years ago

Glad to know that.


Please star us at https://github.com/mediaelement/mediaelement and https://github.com/mediaelement/mediaelement-plugins to continue improving the package and giving it more popularity; also tell your friends/coworkers/etc. to support the project, if you don't mind.It would be greatly appreciated it