zoukankan      html  css  js  c++  java
  • Word and MediaElement

    function jmc_new_lib(){
    // Because we still want the script to load but not the styles
    wp_enqueue_script( 'wp-mediaelement' );
    // Enqueue our own styles here.
    wp_enqueue_style( 'jmc-media-styles', get_template_directory_uri() . '/css/media.css' );
    return '';
    }

    Super sweet if you ask me. That’s great and all but what about the markup? Now we have to think about what needs to be styled right?

    Well, I’ve gone ahead and extracted some of the classes for both the audio and video markup to make it easier:

    .mejs-offscreen {}
    .mejs-container {}
    .svg {}
    .wp-audio-shortcode {}
    .mejs-audio {}
    .mejs-inner {}
    .mejs-mediaelement {}
    .mejs-layers {}
    .mejs-poster {}
    .mejs-layer {}
    .mejs-controls {}
    .mejs-button {}
    .mejs-playpause-button {}
    .mejs-play {}
    .mejs-time {}
    .mejs-currenttime-container {}
    .mejs-currenttime {}
    .mejs-time-rail {}
    .mejs-time-total {}
    .mejs-time-slider {}
    .mejs-time-buffering {}
    .mejs-time-loaded {}
    .mejs-time-current {}
    .mejs-time-handle {}
    .mejs-time-float {}
    .mejs-time-float-current {}
    .mejs-time-float-corner {}
    .mejs-duration-container {}
    .mejs-duration {}
    .mejs-volume-button {}
    .mejs-mute {}
    .mejs-horizontal-volume-slider {}
    .mejs-horizontal-volume-total {}
    .mejs-horizontal-volume-current {}
    .mejs-horizontal-volume-handle {}
    .mejs-clear {}
    .wp-video {}
    .wp-video-shortcode {}
    .mejs-video {}
    .mejs-overlay {}
    .mejs-overlay-loading {}
    .mejs-overlay-error {}
    .mejs-overlay-play {}
    .mejs-overlay-button {}
    .mejs-volume-slider {}
    .mejs-volume-total {}
    .mejs-volume-current {}
    .mejs-volume-handle {}
    .mejs-fullscreen-button {}

    Those are some of the common classes that are used in the final markup. It may not be a complete list but it is a starting point for many and I hope it does help somebody out in theming the audio and video post formats. I will mention this because I know it may be asked down the road: some of those classes may have inline styles so it would be w

    I also created a quick gist for the files if you only wanted to target one media type. This is useful if the user has a playlist.

    In the following example, I’ve removed the core action and am only documenting the basics.

    // remove the scripts/styles originally enqueued
    remove_action( 'wp_playlist_scripts', 'wp_playlist_scripts' );
    // enqueue ours instead
    add_action( 'wp_playlist_scripts', 'jmc_new_liststyles', 10, 2 );
    function jmc_new_liststyles( $type, $style ) {
    // $type is the type of playlist either an 'audio' or 'video'.
    // $style can be core 'light' or 'dark' but can add more by having user input
    // and enqueueing the needed style.
    wp_enqueue_style( 'jmc-style', 'path/to/file' );
    // Because we still want to enqueue the script just not the style.
    wp_enqueue_script( 'wp-playlist' );
    }

  • 相关阅读:
    indy 發郵件的一些說明
    一此常用三方组件的地址(持续更新)
    oraSession直连
    获取关机信息及键盘或鼠标无响应的时长
    DBConnection释放说明
    发送邮件
    文件操作
    plsql中的一些知識
    TNativeXML用法(轉)
    redux中createStore, conbineReducers的简易封装
  • 原文地址:https://www.cnblogs.com/2881064178dinfeng/p/6138419.html
Copyright © 2011-2022 走看看