rtMedia for WordPress, BuddyPress and bbPress - Version 2.1.4

Version Description

  • Added video thumbnail support for addons.
  • Updated the MediaElementJS player library.
Download this release

Release Info

Developer rtcamp
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 2.1.4
Comparing to
See all releases

Code changes from version 2.1.3 to 2.1.4

includes/bp-media-actions.php CHANGED
@@ -67,7 +67,7 @@ function bp_media_show_messages() {
67
add_action('bp_media_before_content', 'bp_media_show_messages');
68
69
/**
70
- * Enqueues all the required scripts and stylesheets for the proper working of BuddyPress Media Component
71
*
72
* @since BP Media 2.0
73
*/
67
add_action('bp_media_before_content', 'bp_media_show_messages');
68
69
/**
70
+ * Enqueues all the required scripts and stylesheets for the proper working of BuddyPress Media.
71
*
72
* @since BP Media 2.0
73
*/
includes/bp-media-admin.php CHANGED
@@ -2,7 +2,7 @@
2
global $bp_media_admin_is_current;
3
$bp_media_admin_is_current = false;
4
/**
5
- * Add the BuddyPress Media Component's options menu in the BuddyPress' options subnavigation.
6
*
7
* @since BP Media 2.0
8
*/
@@ -11,14 +11,14 @@ function bp_media_add_admin_menu() {
11
if (!is_super_admin())
12
return false;
13
14
- $page = add_submenu_page('bp-general-settings', __('BuddyPress Media Component Settings', 'bp-media'), __('MediaBP', 'bp-media'), 'manage_options', 'bp-media-settings', 'bp_media_admin_menu'
15
);
16
add_action('admin_print_styles-' . $page, 'bp_media_admin_enqueue');
17
}
18
//add_action(bp_core_admin_hook(), 'bp_media_add_admin_menu');
19
20
/**
21
- * Displays and updates the options menu of BuddyPress Media Component
22
*
23
* @since BP Media 2.0
24
*/
@@ -86,7 +86,7 @@ function bp_media_admin_menu() {
86
<?php //screen_icon( 'buddypress' ); ?>
87
<div id="icon-bp-media" class="icon32"><br></div>
88
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Media', 'bp-media' ) ); ?></h2>
89
- <h2>BuddyPress Media Component Settings</h2>
90
<?php if(count($bp_media_errors)) { ?>
91
<div class="error"><p><?php foreach($bp_media_errors as $error) echo $error.'<br/>'; ?></p></div>
92
<?php } if(count($bp_media_messages)){?>
@@ -161,7 +161,7 @@ function bp_media_admin_menu() {
161
}
162
163
/**
164
- * Default BuddyPress Media Component admin sidebar with metabox styling
165
*
166
* @since BP Media 2.0
167
*/
@@ -204,7 +204,7 @@ function bp_media_default_admin_sidebar() {
204
}
205
206
/**
207
- * Enqueues the scripts and stylesheets needed for the BuddyPress Media Component's options page
208
*/
209
function bp_media_admin_enqueue() {
210
$admin_js = trailingslashit(site_url()).'?bp_media_get_feeds=1';
2
global $bp_media_admin_is_current;
3
$bp_media_admin_is_current = false;
4
/**
5
+ * Add the BuddyPress Media's options menu in the BuddyPress' options subnavigation.
6
*
7
* @since BP Media 2.0
8
*/
11
if (!is_super_admin())
12
return false;
13
14
+ $page = add_submenu_page('bp-general-settings', __('BuddyPress Media Settings', 'bp-media'), __('MediaBP', 'bp-media'), 'manage_options', 'bp-media-settings', 'bp_media_admin_menu'
15
);
16
add_action('admin_print_styles-' . $page, 'bp_media_admin_enqueue');
17
}
18
//add_action(bp_core_admin_hook(), 'bp_media_add_admin_menu');
19
20
/**
21
+ * Displays and updates the options menu of BuddyPress Media
22
*
23
* @since BP Media 2.0
24
*/
86
<?php //screen_icon( 'buddypress' ); ?>
87
<div id="icon-bp-media" class="icon32"><br></div>
88
<h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs( __( 'Media', 'bp-media' ) ); ?></h2>
89
+ <h2>BuddyPress Media Settings</h2>
90
<?php if(count($bp_media_errors)) { ?>
91
<div class="error"><p><?php foreach($bp_media_errors as $error) echo $error.'<br/>'; ?></p></div>
92
<?php } if(count($bp_media_messages)){?>
161
}
162
163
/**
164
+ * Default BuddyPress Media admin sidebar with metabox styling
165
*
166
* @since BP Media 2.0
167
*/
204
}
205
206
/**
207
+ * Enqueues the scripts and stylesheets needed for the BuddyPress Media's options page
208
*/
209
function bp_media_admin_enqueue() {
210
$admin_js = trailingslashit(site_url()).'?bp_media_get_feeds=1';
includes/bp-media-class-wordpress.php CHANGED
@@ -12,6 +12,7 @@ class BP_Media_Host_Wordpress {
12
$owner, //Owner of the entry
13
$attachment_id, //The attachment ID of the media file
14
$delete_url, //The delete url for the media
15
$edit_url; //The edit page's url for the media
16
17
/**
@@ -47,26 +48,30 @@ class BP_Media_Host_Wordpress {
47
$this->name = $media->post_title;
48
$this->owner = $media->post_author;
49
$this->type = get_post_meta($media->ID, 'bp_media_type', true);
50
switch ($this->type) {
51
case 'video' :
52
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_ENTRY_SLUG . '/' . $this->id);
53
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_EDIT_SLUG . '/' . $this->id);
54
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
55
break;
56
case 'audio' :
57
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_ENTRY_SLUG . '/' . $this->id);
58
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_EDIT_SLUG . '/' . $this->id);
59
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
60
break;
61
case 'image' :
62
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_ENTRY_SLUG . '/' . $this->id);
63
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_EDIT_SLUG . '/' . $this->id);
64
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
65
break;
66
default :
67
return false;
68
}
69
- $this->attachment_id = get_post_meta($this->id, 'bp_media_child_attachment', true);
70
}
71
72
/**
@@ -234,7 +239,13 @@ class BP_Media_Host_Wordpress {
234
$activity_content .='<div class="bp_media_content">';
235
switch ($this->type) {
236
case 'video' :
237
- $activity_content.='<video src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
238
break;
239
case 'audio' :
240
$activity_content.='<audio src="' . wp_get_attachment_url($attachment_id) . '" width="320" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span><script>bp_media_create_element("bp_media_audio_' . $this->id . '_' . $bp_media_counter . '");</script>';
@@ -281,7 +292,13 @@ class BP_Media_Host_Wordpress {
281
$content = '<div class="bp_media_title">' . wp_html_excerpt($this->name, $bp_media_default_excerpts['single_entry_title']) . '</div><div class="bp_media_content">';
282
switch ($this->type) {
283
case 'video' :
284
- $content.='<video src="' . wp_get_attachment_url($this->attachment_id) . '" width="' . $bp_media_default_sizes['single_video']['width'] . '" height="' . ($bp_media_default_sizes['single_video']['height'] == 0 ? 'auto' : $bp_media_default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>';
285
break;
286
case 'audio' :
287
$content.='<audio src="' . wp_get_attachment_url($this->attachment_id) . '" width="' . $bp_media_default_sizes['single_audio']['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->id . '" controls="controls" preload="none" ></audio><script>bp_media_create_element("bp_media_audio_' . $this->id . '");</script>';
@@ -307,10 +324,17 @@ class BP_Media_Host_Wordpress {
307
$attachment = get_post_meta($this->id, 'bp_media_child_attachment', true);
308
switch ($this->type) {
309
case 'video' :
310
?>
311
<li>
312
<a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>">
313
- <img src="<?php echo plugins_url('img/video_thumb.png', __FILE__) ?>" />
314
</a>
315
<h3 title="<?php echo $this->name ?>"><a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>"><?php echo $this->name ?></a></h3>
316
</li>
12
$owner, //Owner of the entry
13
$attachment_id, //The attachment ID of the media file
14
$delete_url, //The delete url for the media
15
+ $thumbnail_id, //The thumbnail's url
16
$edit_url; //The edit page's url for the media
17
18
/**
48
$this->name = $media->post_title;
49
$this->owner = $media->post_author;
50
$this->type = get_post_meta($media->ID, 'bp_media_type', true);
51
+ $this->attachment_id = get_post_meta($this->id, 'bp_media_child_attachment', true);
52
switch ($this->type) {
53
case 'video' :
54
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_ENTRY_SLUG . '/' . $this->id);
55
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_VIDEOS_EDIT_SLUG . '/' . $this->id);
56
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_VIDEOS_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
57
+ $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail',true);
58
break;
59
case 'audio' :
60
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_ENTRY_SLUG . '/' . $this->id);
61
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_AUDIO_EDIT_SLUG . '/' . $this->id);
62
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_AUDIO_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
63
+ $this->thumbnail_id = get_post_meta($this->id, 'bp_media_thumbnail',true);
64
break;
65
case 'image' :
66
$this->url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_ENTRY_SLUG . '/' . $this->id);
67
$this->edit_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_IMAGES_EDIT_SLUG . '/' . $this->id);
68
$this->delete_url = trailingslashit(bp_core_get_user_domain($this->owner) . BP_MEDIA_IMAGES_SLUG . '/' . BP_MEDIA_DELETE_SLUG . '/' . $this->id);
69
+ $image_array = image_downsize($this->attachment_id, 'bp_media_single_image');
70
+ $this->thumbnail_id = $this->attachment_id;
71
break;
72
default :
73
return false;
74
}
75
}
76
77
/**
239
$activity_content .='<div class="bp_media_content">';
240
switch ($this->type) {
241
case 'video' :
242
+ if($this->thumbnail_id){
243
+ $image_array = image_downsize($this->thumbnail_id, 'bp_media_activity_image');
244
+ $activity_content.='<video poster="'.$image_array[0].'" src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
245
+ }
246
+ else{
247
+ $activity_content.='<video src="' . wp_get_attachment_url($attachment_id) . '" width="320" height="240" type="video/mp4" id="bp_media_video_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none"></video></span><script>bp_media_create_element("bp_media_video_' . $this->id . '_' . $bp_media_counter . '");</script>';
248
+ }
249
break;
250
case 'audio' :
251
$activity_content.='<audio src="' . wp_get_attachment_url($attachment_id) . '" width="320" type="audio/mp3" id="bp_media_audio_' . $this->id . '_' . $bp_media_counter . '" controls="controls" preload="none" ></audio></span><script>bp_media_create_element("bp_media_audio_' . $this->id . '_' . $bp_media_counter . '");</script>';
292
$content = '<div class="bp_media_title">' . wp_html_excerpt($this->name, $bp_media_default_excerpts['single_entry_title']) . '</div><div class="bp_media_content">';
293
switch ($this->type) {
294
case 'video' :
295
+ if($this->thumbnail_id){
296
+ $image_array = image_downsize($this->thumbnail_id, 'bp_media_single_image');
297
+ $content.='<video poster="'.$image_array[0].'" src="' . wp_get_attachment_url($this->attachment_id) . '" width="' . $bp_media_default_sizes['single_video']['width'] . '" height="' . ($bp_media_default_sizes['single_video']['height'] == 0 ? 'auto' : $bp_media_default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>';
298
+ }
299
+ else{
300
+ $content.='<video src="' . wp_get_attachment_url($this->attachment_id) . '" width="' . $bp_media_default_sizes['single_video']['width'] . '" height="' . ($bp_media_default_sizes['single_video']['height'] == 0 ? 'auto' : $bp_media_default_sizes['single_video']['height']) . '" type="video/mp4" id="bp_media_video_' . $this->id . '" controls="controls" preload="none"></video><script>bp_media_create_element("bp_media_video_' . $this->id . '");</script>';
301
+ }
302
break;
303
case 'audio' :
304
$content.='<audio src="' . wp_get_attachment_url($this->attachment_id) . '" width="' . $bp_media_default_sizes['single_audio']['width'] . '" type="audio/mp3" id="bp_media_audio_' . $this->id . '" controls="controls" preload="none" ></audio><script>bp_media_create_element("bp_media_audio_' . $this->id . '");</script>';
324
$attachment = get_post_meta($this->id, 'bp_media_child_attachment', true);
325
switch ($this->type) {
326
case 'video' :
327
+ if($this->thumbnail_id){
328
+ $medium_array = image_downsize($this->thumbnail_id, 'thumbnail');
329
+ $thumb_url = $medium_array[0];
330
+ }
331
+ else{
332
+ $thumb_url = plugins_url('img/video_thumb.png', __FILE__);
333
+ }
334
?>
335
<li>
336
<a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>">
337
+ <img src="<?php echo $thumb_url; ?>" />
338
</a>
339
<h3 title="<?php echo $this->name ?>"><a href="<?php echo $this->url ?>" title="<?php echo $this->description ?>"><?php echo $this->name ?></a></h3>
340
</li>
includes/bp-media-loader.php CHANGED
@@ -1,6 +1,6 @@
1
<?php
2
/**
3
- * The Main loader file of BuddyPress Media Component Plugin
4
*/
5
/* Exit if accessed directlly. */
6
@@ -93,7 +93,7 @@ if (file_exists(BP_MEDIA_PLUGIN_DIR . '/languages/' . get_locale() . '.mo'))
93
load_textdomain('bp-media', BP_MEDIA_PLUGIN_DIR . '/languages/' . get_locale() . '.mo');
94
95
/**
96
- * BP Media Component Class, extends BP_Component
97
*
98
* @see BP_Component
99
*
@@ -113,7 +113,7 @@ class BP_Media_Component extends BP_Component {
113
);
114
115
/**
116
- * Constructor for the BuddyPress Media Component
117
*
118
* @since BP Media 2.0
119
*/
@@ -126,7 +126,7 @@ class BP_Media_Component extends BP_Component {
126
}
127
128
/**
129
- * Includes the files required for the BuddyPress Media Component and calls the parent class' includes function
130
*
131
* @since BP Media 2.0
132
*/
@@ -149,7 +149,7 @@ class BP_Media_Component extends BP_Component {
149
}
150
151
/**
152
- * Initializes the global variables of the BuddyPress Media component and its parent class.
153
*/
154
function setup_globals() {
155
global $bp;
@@ -331,7 +331,7 @@ class BP_Media_Component extends BP_Component {
331
$args = array(
332
'label' => __('Media', 'bp-media'),
333
'labels' => $labels,
334
- 'description' => 'BuddyPress Media Component\'s Media Files',
335
'public' => true,
336
'show_ui' => false,
337
'supports' => array('title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields')
1
<?php
2
/**
3
+ * The Main loader file of BuddyPress Media Plugin
4
*/
5
/* Exit if accessed directlly. */
6
93
load_textdomain('bp-media', BP_MEDIA_PLUGIN_DIR . '/languages/' . get_locale() . '.mo');
94
95
/**
96
+ * BP Media Class, extends BP_Component
97
*
98
* @see BP_Component
99
*
113
);
114
115
/**
116
+ * Constructor for the BuddyPress Media
117
*
118
* @since BP Media 2.0
119
*/
126
}
127
128
/**
129
+ * Includes the files required for the BuddyPress Media and calls the parent class' includes function
130
*
131
* @since BP Media 2.0
132
*/
149
}
150
151
/**
152
+ * Initializes the global variables of the BuddyPress Media and its parent class.
153
*/
154
function setup_globals() {
155
global $bp;
331
$args = array(
332
'label' => __('Media', 'bp-media'),
333
'labels' => $labels,
334
+ 'description' => 'BuddyPress Media\'s Media Files',
335
'public' => true,
336
'show_ui' => false,
337
'supports' => array('title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields')
includes/bp-media-screens.php CHANGED
@@ -1,7 +1,7 @@
1
<?php
2
3
/**
4
- * Screens for all the slugs defined in the BuddyPress Media Component
5
*/
6
7
/* Exit if accessed directlly. */
1
<?php
2
3
/**
4
+ * Screens for all the slugs defined in the BuddyPress Media
5
*/
6
7
/* Exit if accessed directlly. */
includes/css/bp-media-style.css CHANGED
@@ -1,9 +1,12 @@
1
/*
2
- * Default stylesheet for BuddyPress Media Component
3
*/
4
.bp_media_content img{
5
max-width:98%;
6
}
7
.bp_media_title {
8
display:block;
9
font-size:20px;
1
/*
2
+ * Default stylesheet for BuddyPress Media
3
*/
4
.bp_media_content img{
5
max-width:98%;
6
}
7
+ .bp_media_content .mejs-poster img{
8
+ max-width: 100%;
9
+ }
10
.bp_media_title {
11
display:block;
12
font-size:20px;
includes/media-element/flashmediaelement.swf CHANGED
Binary file
includes/media-element/jquery.js ADDED
@@ -0,0 +1,9300 @@