Ejemplo n.º 1
0
/**
 * 
 * Insert a playlist into the editor for a page or post through the media manager
 * 
 */
function s3video_playlist_media_manager()
{
    if (isset($_POST['insertPlaylistId']) && !empty($_POST['insertPlaylistId'])) {
        $insertHtml = "[S3_embed_playlist id='" . $_POST['insertPlaylistId'] . "']";
        media_send_to_editor($insertHtml);
        die;
    }
    $pluginSettings = s3_video_check_plugin_settings();
    // Load playlist management class
    require_once WP_PLUGIN_DIR . '/s3-video/includes/playlist_management.php';
    $playlistManagement = new s3_playlist_management();
    // Load all of the existing playlists
    $existingPlaylists = $playlistManagement->getAllPlaylists();
    require_once WP_PLUGIN_DIR . '/s3-video/views/playlist-management/media_manager_show_playlists.php';
}
Ejemplo n.º 2
0
/**
 * 
 * Load the player dependent Javascript
 */
function s3_video_load_player_js()
{
    wp_enqueue_script('jquery');
    wp_enqueue_script('swfobject');
    $pluginSettings = s3_video_check_plugin_settings();
    if (empty($pluginSettings['amazon_s3_video_player']) || $pluginSettings['amazon_s3_video_player'] == 'flowplayer') {
        wp_enqueue_script('flowPlayer', WP_PLUGIN_URL . '/s3-video/js/flowplayer-3.2.12.js', array('jquery'), '1.0');
        wp_enqueue_script('flowPlayerPlaylist', WP_PLUGIN_URL . '/s3-video/js/jquery.playlist.js', array('jquery'), '1.0');
    } else {
        // If any playlists exist load both players
        require_once WP_PLUGIN_DIR . '/s3-video/includes/playlist_management.php';
        $playlistManagement = new s3_playlist_management();
        if ($playlistManagement->getAllPlaylists()) {
            wp_enqueue_script('flowPlayer', WP_PLUGIN_URL . '/s3-video/js/flowplayer-3.2.12.js', array('jquery'), '1.0');
            wp_enqueue_script('flowPlayerPlaylist', WP_PLUGIN_URL . '/s3-video/js/jquery.playlist.js', array('jquery'), '1.0');
        }
        wp_enqueue_script('videoJS', WP_PLUGIN_URL . '/s3-video/js/video.min.js');
        wp_register_style('s3_video_videoJS_css', WP_PLUGIN_URL . '/s3-video/css/video-js.css');
        wp_enqueue_style('s3_video_videoJS_css');
    }
}