'video', 'callback' => 'su_shortcode_video', 'image' => su_get_plugin_url() . 'admin/images/shortcodes/video.svg', 'name' => __( 'Video', 'shortcodes-ultimate' ), 'type' => 'single', 'group' => 'media', 'atts' => array( 'url' => array( 'type' => 'upload', 'default' => '', 'name' => __( 'File', 'shortcodes-ultimate' ), 'desc' => __( 'Url to mp4/flv video-file', 'shortcodes-ultimate' ), ), 'poster' => array( 'type' => 'upload', 'default' => '', 'name' => __( 'Poster', 'shortcodes-ultimate' ), 'desc' => __( 'Url to poster image, that will be shown before playback', 'shortcodes-ultimate' ), ), 'title' => array( 'values' => array(), 'default' => '', 'name' => __( 'Title', 'shortcodes-ultimate' ), 'desc' => __( 'Player title', 'shortcodes-ultimate' ), ), 'width' => array( 'type' => 'slider', 'min' => 200, 'max' => 1600, 'step' => 20, 'default' => 600, 'name' => __( 'Width', 'shortcodes-ultimate' ), 'desc' => __( 'Player width', 'shortcodes-ultimate' ), ), 'height' => array( 'type' => 'slider', 'min' => 200, 'max' => 1600, 'step' => 20, 'default' => 300, 'name' => __( 'Height', 'shortcodes-ultimate' ), 'desc' => __( 'Player height', 'shortcodes-ultimate' ), ), 'controls' => array( 'type' => 'bool', 'default' => 'yes', 'name' => __( 'Controls', 'shortcodes-ultimate' ), 'desc' => __( 'Show player controls (play/pause etc.) or not', 'shortcodes-ultimate' ), ), 'autoplay' => array( 'type' => 'bool', 'default' => 'no', 'name' => __( 'Autoplay', 'shortcodes-ultimate' ), 'desc' => __( 'Play file automatically when page is loaded', 'shortcodes-ultimate' ), ), 'loop' => array( 'type' => 'bool', 'default' => 'no', 'name' => __( 'Loop', 'shortcodes-ultimate' ), 'desc' => __( 'Repeat when playback is ended', 'shortcodes-ultimate' ), ), 'class' => array( 'type' => 'extra_css_class', 'name' => __( 'Extra CSS class', 'shortcodes-ultimate' ), 'desc' => __( 'Additional CSS class name(s) separated by space(s)', 'shortcodes-ultimate' ), 'default' => '', ), ), 'desc' => __( 'Custom video player', 'shortcodes-ultimate' ), 'example' => 'media', 'icon' => 'play-circle', ) ); function su_shortcode_video( $atts = null, $content = null ) { $atts = shortcode_atts( array( 'url' => false, 'poster' => false, 'title' => '', 'width' => 600, 'height' => 300, 'controls' => 'yes', 'autoplay' => 'no', 'loop' => 'no', 'class' => '', ), $atts, 'video' ); if ( ! $atts['url'] ) { return su_error_message( 'Video', __( 'please specify correct url', 'shortcodes-ultimate' ) ); } $atts['url'] = su_do_attribute( $atts['url'] ); $id = uniqid( 'su_video_player_' ); if ( ! $atts['url'] ) { return su_error_message( 'Video', __( 'please specify correct url', 'shortcodes-ultimate' ) ); } $title = $atts['title'] ? '
' . $atts['title'] . '
' : ''; su_query_asset( 'css', 'su-shortcodes' ); su_query_asset( 'js', 'jquery' ); su_query_asset( 'js', 'jplayer' ); su_query_asset( 'js', 'su-shortcodes' ); return '
' . $title . '
'; }