Rolling custom control buttons

戏子无情 提交于 2019-12-11 01:19:58

问题


do you have a reference or tutorial on customizing skins graphics/css for mejs?

here's what i've hacked on:

i copied the mejs-ted block in the mejs-skins.css file and renamed its elements to mejs-custom. i created a new PNG file similar to the existing control-ted.png and noted the coordinates of each control. with those coordinates i changed the x/y offsets in mejs-custom (i could really use help with that, too).

but now how to activate this skin? and can you confirm the technique above is correct procedure to create skins?

http://mediaelementjs.com source has switchable skins, but the switching mechanism is pretty well obfuscated in the code, and the mediaelementplayer-skins.html file is missing from the demos section of the mu distribution.


回答1:


Set up your player then use the changeSkin() method to add the class of your skin to the container div, which is reflected in your skin css file

 var player = new MediaElementPlayer('#player-ID');


   player.changeSkin('skin-container-class');

Then you can style all the elements.

.skin-container-class .mejs-controls {
/*stylez*/
}


来源:https://stackoverflow.com/questions/8059843/rolling-custom-control-buttons

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!