rtMedia for WordPress, BuddyPress and bbPress - Version 4.1.2

Version Description

Requires BuddyPress 1.7 or higher, if using BuddyPress. Update the original audio URL with transcoded audio URL in activity.

=

Download this release

Release Info

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

Code changes from version 4.1.1 to 4.1.2

app/main/controllers/template/rt-template-functions.php CHANGED
@@ -2884,18 +2884,32 @@ function rtm_get_server_var( $server_key, $filter_type = 'FILTER_SANITIZE_STRING
2884
2885
}
2886
2887
function replace_src_with_transcoded_file_url( $html, $rtmedia_media ) {
2888
2889
if ( empty( $rtmedia_media->media_id ) ) {
2890
return $html;
2891
}
2892
2893
- $media_type = 'mp4';
2894
$attachment_id = $rtmedia_media->media_id;
2895
2896
$medias = get_post_meta( $attachment_id, '_rt_media_transcoded_files', true );
2897
- if ( isset( $medias[ $media_type ] ) && is_array( $medias[ $media_type ] ) && ! empty( $medias[ $media_type ][0] ) ) {
2898
- $file_url = $medias[ $media_type ][0];
2899
/* for WordPress backward compatibility */
2900
if ( function_exists( 'wp_get_upload_dir' ) ) {
2901
$uploads = wp_get_upload_dir();
@@ -2915,3 +2929,20 @@ function replace_src_with_transcoded_file_url( $html, $rtmedia_media ) {
2915
}
2916
2917
add_filter( 'rtmedia_single_content_filter', 'replace_src_with_transcoded_file_url', 100, 2 );
2884
2885
}
2886
2887
+ /**
2888
+ * Replace original src with the transcoded media src
2889
+ * @param string $html
2890
+ * @param object $rtmedia_media
2891
+ *
2892
+ * @return string
2893
+ */
2894
function replace_src_with_transcoded_file_url( $html, $rtmedia_media ) {
2895
2896
if ( empty( $rtmedia_media->media_id ) ) {
2897
return $html;
2898
}
2899
2900
+ $media_type = '';
2901
$attachment_id = $rtmedia_media->media_id;
2902
2903
+ if ( 'video' === $rtmedia_media->media_type ) {
2904
+ $media_type = 'mp4';
2905
+ } elseif ( 'music' === $rtmedia_media->media_type ) {
2906
+ $media_type = 'mp3';
2907
+ } else {
2908
+ return $html;
2909
+ }
2910
+
2911
$medias = get_post_meta( $attachment_id, '_rt_media_transcoded_files', true );
2912
+ if ( $file_url = rtt_is_video_exists( $medias, $media_type ) ) {
2913
/* for WordPress backward compatibility */
2914
if ( function_exists( 'wp_get_upload_dir' ) ) {
2915
$uploads = wp_get_upload_dir();
2929
}
2930
2931
add_filter( 'rtmedia_single_content_filter', 'replace_src_with_transcoded_file_url', 100, 2 );
2932
+
2933
+ /**
2934
+ * Check if URL exists of a given media type
2935
+ *
2936
+ * @param array $medias
2937
+ * @param string $media_type
2938
+ *
2939
+ * @return boolen|string
2940
+ */
2941
+ function rtt_is_video_exists( $medias, $media_type = 'mp4' ) {
2942
+ if ( empty( $medias ) || empty( $media_type ) ) {
2943
+ return false;
2944
+ }
2945
+ if ( isset( $medias[ $media_type ] ) && is_array( $medias[ $media_type ] ) && ! empty( $medias[ $media_type ][0] ) ) {
2946
+ return $medias[ $media_type ][0];
2947
+ }
2948
+ }
index.php CHANGED
@@ -4,7 +4,7 @@
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: https://rtmedia.io/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
- Version: 4.1.1
8
Author: rtCamp
9
Text Domain: buddypress-media
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
4
Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
5
Plugin URI: https://rtmedia.io/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
6
Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
7
+ Version: 4.1.2
8
Author: rtCamp
9
Text Domain: buddypress-media
10
Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: 4.6
9
- Stable tag: 4.1.1
10
11
Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & more. All this works on mobile/tablets devices.
12
@@ -135,6 +135,9 @@ http://www.youtube.com/watch?v=dJrykKQGDcs
135
136
== Changelog ==
137
138
= 4.1.1 [Aug 24, 2016] =
139
* Add backward compatibility
140
@@ -1207,8 +1210,8 @@ http://www.youtube.com/watch?v=dJrykKQGDcs
1207
1208
== Upgrade Notice ==
1209
1210
- = 4.1.1 =
1211
- Requires BuddyPress 1.7 or higher, if using BuddyPress. Add backward compatibility.
1212
1213
== Sponsors ==
1214
6
License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
Requires at least: WordPress 3.6
8
Tested up to: 4.6
9
+ Stable tag: 4.1.2
10
11
Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & more. All this works on mobile/tablets devices.
12
135
136
== Changelog ==
137
138
+ = 4.1.2 [Aug 25, 2016] =
139
+ * Update the original audio URL with transcoded audio URL in activity
140
+
141
= 4.1.1 [Aug 24, 2016] =
142
* Add backward compatibility
143
1210
1211
== Upgrade Notice ==
1212
1213
+ = 4.1.2 =
1214
+ Requires BuddyPress 1.7 or higher, if using BuddyPress. Update the original audio URL with transcoded audio URL in activity.
1215
1216
== Sponsors ==
1217