Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions css/s3-browser.css
Original file line number Diff line number Diff line change
Expand Up @@ -375,4 +375,14 @@
right: 0;
bottom: 0;
z-index: 10;
}

.job-status-completed.attachment-preview {
background: #ccf0cc;
}
.job-status-error.attachment-preview {
background: #fda5a5;
}
.job-status-processing.attachment-preview {
background: #eee69d;
}
14 changes: 12 additions & 2 deletions js/media-library-browser-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,20 @@ function fv_flowplayer_browser_browse(data, options) {
}
}

file.append('<div class="attachment-preview js--select-attachment type-video subtype-mp4 landscape' + (options && options.extraAttachmentClass ? ' ' + options.extraAttachmentClass : '') + '">'
var css_class = 'attachment-preview js--select-attachment type-video subtype-mp4 landscape';
if( options && options.extraAttachmentClass ) {
css_class += ' ' + options.extraAttachmentClass;
}

if( f.status ) {
css_class += ' job-status-'+f.status;
}

file.append('<div class="'+css_class+'">'
+ '<div class="thumbnail"' + (isPicture || (options && options.noFileName) ? ' title="' + name + '"' : '') + '>'
+ icon
+ '<div class="filename' + (isPicture || (options && options.noFileName) ? ' hidden' : '') + '">'
+ '<div data-modified="' + f.modified + '" data-size="' + f.size + '" data-link="' + f.link + '"' + (f.duration ? ' data-duration="' + f.duration + '"' : '') + ' data-extra=\''+JSON.stringify(f.extra)+'\'>' + name + '</div>'
+ '<div data-modified="' + f.modified + '" data-size="' + f.size + '" data-link="' + f.link + '"' + '" data-status="' + f.status + '"' + (f.duration ? ' data-duration="' + f.duration + '"' : '') + ' data-extra=\''+JSON.stringify(f.extra)+'\'>' + name + '</div>' + ' data-extra=\''+JSON.stringify(f.extra)+'\'>' + name + '</div>'
+ '</div>'
+ progress
+ '</div>'
Expand Down Expand Up @@ -956,6 +965,7 @@ jQuery( function($) {
'\t\t\t\t<div class="file-size">' + (!fSizeTextual ? (fSize > -1 ? fSize + ' ' + sizeSuffix : fDuration) : '') + '</div>\n' +
(fExtraDisplayData ? '\t\t\t\t<div class="uploaded"><br /><strong><em>' + fExtraDisplayData + '</em></strong></div>\n' : '') +
'\t\t\t</div>\n' +
'\t\t\t\t<div class="status">' + ( $filenameDiv.data('status') != 'undefined' ? $filenameDiv.data('status') : '' ) + '</div>\n' +
( ( splashValue && $filenameDiv.data('link').match(/\.(jpg|jpeg|png|gif)$/) ) ? '<div><i>Found matching splash screen image</i></div>' : '') +
'\t\t</div>\n' +
'\n' +
Expand Down
2 changes: 1 addition & 1 deletion models/digitalocean-spaces-browser.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,6 @@ public function isSetUpCorrectly() {
}

global $FV_Player_DigitalOcean_Spaces_Browser;
$FV_Player_DigitalOcean_Spaces_Browser = new FV_Player_DigitalOcean_Spaces_Browser( 'wp_ajax_load_dos_assets' );
$FV_Player_DigitalOcean_Spaces_Browser = new FV_Player_DigitalOcean_Spaces_Browser( array('ajax_action_name' => 'wp_ajax_load_dos_assets', 'browser_type' => 'dos') );

endif;
5 changes: 5 additions & 0 deletions models/digitalocean-spaces.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ function options() {
// TODO: Fix width
// TODO: Add custom domain for CDN
global $fv_fp;

if( class_exists('FV_Player_Coconut') ) {
_e('FV Player Coconut is installed, this space will be used only as source.', 'fv-wordpress-flowplayer');
}

?>
<table class="form-table2" style="margin: 5px; ">
<?php
Expand Down
2 changes: 1 addition & 1 deletion models/media-browser-s3.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ function get_formatted_assets_data() {

}

new FV_Player_Media_Browser_S3( 'wp_ajax_load_s3_assets' );
new FV_Player_Media_Browser_S3( array( 'ajax_action_name' => 'wp_ajax_load_s3_assets', 'browser_type' => 's3' ) );
4 changes: 4 additions & 0 deletions models/media-browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

abstract class FV_Player_Media_Browser {

public $browser_type = 'media_browser';
public $ajax_action_name = false;
private $s3_assets_loaded = false;

Expand All @@ -22,6 +23,7 @@ public function __construct($args) {
$args = wp_parse_args($args ,array(
'ajax_action_name' => false,
'ajax_action_name_add_new_folder' => false,
'browser_type' => 'media_browser'
)
);

Expand Down Expand Up @@ -183,6 +185,8 @@ function get_output_items( $output, $s3Client, $request_path, $paged, $date_form
$item['items'] = array();
}

$item = apply_filters( 'fv_player_media_browser_item', $item, $this->browser_type );

$output['items'][] = $item;

if (strtolower(substr($item['name'], strrpos($item['name'], '.') + 1)) === 'ts') {
Expand Down