user1034552
user1034552

Reputation: 101

Mediaelement.js - Would like to Remove ALL Controls - Only Display Video

I am trying to replace my swf header in my webpage with mp4. I like MediaElement.js but I can't remove the controls. I don't want to hide the controls, I want to remove them completely... and just display the looping video.

Any suggestions would be greatly appreciated.

Upvotes: 10

Views: 15902

Answers (5)

Camilo Hoyos
Camilo Hoyos

Reputation: 131

I think a better solution is:

Set features property:

features: []

Insert this in your css:

.mejs-container .mejs-controls { visibility:hidden !important; }

That way you can pause-play by clicking the video.

Upvotes: 13

Benjamin
Benjamin

Reputation: 8248

Remove the "controls" attribute out of the video tag completely.

Generally in the video tag, any attribute that you want to set to false, should be removed completely instead of setting it to "false" or "".

Careful with removing attributes from within the video tag. Removing the "controls" attribute from the video tag renders a bug in Safari : Safari doesn't play the video anymore. It has something to do with Safari waiting for the controls to be loaded -wether native or not- before authorizing the video to be played.

Upvotes: 4

Robert
Robert

Reputation: 81

You have to combine those answers:

  1. set

    features: [],
    
  2. insert this in your css:

    .mejs-container .mejs-controls {
      display: none !important;
    }
    

Important

When you do this, you can't pause the video by clicking on it.

Upvotes: 8

Migroschrott
Migroschrott

Reputation: 11

Remove the "controls" attribute out of the video tag completely.

<video id="my-video" preload="auto" width="860" height="650">

Generally in the video tag, any attribute that you want to set to false, should be removed completely instead of setting it to "false" or "".

Upvotes: 1

dubvfan87
dubvfan87

Reputation: 641

when you set up the MediaElement options you can set features:

to remove everything just set it to an empty array

...
features: ['playpause','progress','current','duration','tracks','volume','fullscreen'],
...

becomes
...
features: [],
...

Upvotes: 4

Related Questions