Changeset 3301420
- Timestamp:
- 05/27/2025 11:10:21 AM (8 months ago)
- Location:
- godam
- Files:
-
- 10 edited
- 1 copied
-
tags/1.0.8 (copied) (copied from godam/trunk)
-
tags/1.0.8/admin/godam-transcoder-actions.php (modified) (5 diffs)
-
tags/1.0.8/godam.php (modified) (2 diffs)
-
tags/1.0.8/inc/classes/class-assets.php (modified) (7 diffs)
-
tags/1.0.8/languages/godam.pot (modified) (10 diffs)
-
tags/1.0.8/readme.txt (modified) (3 diffs)
-
trunk/admin/godam-transcoder-actions.php (modified) (5 diffs)
-
trunk/godam.php (modified) (2 diffs)
-
trunk/inc/classes/class-assets.php (modified) (7 diffs)
-
trunk/languages/godam.pot (modified) (10 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
godam/tags/1.0.8/admin/godam-transcoder-actions.php
r3294292 r3301420 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Add a field for the transcoded URL to the media attachment edit screen. 15 * 16 * @param array $form_fields An array of attachment form fields. 17 * @param object $post The attachment post object. 18 * @return array The modified array of attachment form fields. 19 */ 20 function rtgodam_add_transcoded_url_field( $form_fields, $post ) { 13 if ( ! function_exists( 'rtgodam_add_transcoded_url_field' ) ) { 21 14 22 // Check if post is of type attachment. 23 if ( 'attachment' !== $post->post_type ) { 15 /** 16 * Add a field for the transcoded URL to the media attachment edit screen. 17 * 18 * @param array $form_fields An array of attachment form fields. 19 * @param object $post The attachment post object. 20 * @return array The modified array of attachment form fields. 21 */ 22 function rtgodam_add_transcoded_url_field( $form_fields, $post ) { 23 24 // Check if post is of type attachment. 25 if ( 'attachment' !== $post->post_type ) { 26 return $form_fields; 27 } 28 29 // Check if attachment is of type video. 30 $mime_type = get_post_mime_type( $post->ID ); 31 32 if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) { 33 return $form_fields; 34 } 35 36 $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true ); 37 38 $easydam_settings = get_option( 'rtgodam-settings', array() ); 39 40 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 41 42 // Add the transcoded URL field. 43 $form_fields['transcoded_url'] = array( 44 'label' => __( 'Transcoded CDN URL', 'godam' ), 45 'input' => 'html', 46 'html' => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>', 47 'value' => esc_url( $transcoded_url ), 48 'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ), 49 ); 50 24 51 return $form_fields; 25 52 } 26 27 // Check if attachment is of type video.28 $mime_type = get_post_mime_type( $post->ID );29 30 if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {31 return $form_fields;32 }33 34 $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );35 36 $easydam_settings = get_option( 'rtgodam-settings', array() );37 38 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );39 40 // Add the transcoded URL field.41 $form_fields['transcoded_url'] = array(42 'label' => __( 'Transcoded CDN URL', 'godam' ),43 'input' => 'html',44 'html' => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',45 'value' => esc_url( $transcoded_url ),46 'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),47 );48 49 return $form_fields;50 53 } 51 54 52 55 add_filter( 'attachment_fields_to_edit', 'rtgodam_add_transcoded_url_field', 10, 2 ); 53 56 54 /**55 * Save the transcoded URL field when the attachment is saved.56 *57 * @param array $post The post data for the attachment.58 * @param array $attachment The attachment data.59 * @return array The post data for the attachment.60 */61 function rtgodam_save_transcoded_url_field( $post, $attachment ) {62 // Check if adaptive bitrate streaming is enabled.63 $easydam_settings = get_option( 'rtgodam-settings', array() );64 57 65 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 58 if ( ! function_exists( 'rtgodam_save_transcoded_url_field' ) ) { 66 59 67 if ( ! $adaptive_bitrate_enabled ) { 60 /** 61 * Save the transcoded URL field when the attachment is saved. 62 * 63 * @param array $post The post data for the attachment. 64 * @param array $attachment The attachment data. 65 * @return array The post data for the attachment. 66 */ 67 function rtgodam_save_transcoded_url_field( $post, $attachment ) { 68 // Check if adaptive bitrate streaming is enabled. 69 $easydam_settings = get_option( 'rtgodam-settings', array() ); 70 71 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 72 73 if ( ! $adaptive_bitrate_enabled ) { 74 return $post; 75 } 76 77 if ( isset( $attachment['transcoded_url'] ) ) { 78 // Check the user's permissions. 79 if ( ! current_user_can( 'edit_post', $post['ID'] ) ) { 80 return $post; 81 } 82 // Update the post meta with the new value. 83 update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) ); 84 } 85 68 86 return $post; 69 87 } 70 71 if ( isset( $attachment['transcoded_url'] ) ) {72 // Check the user's permissions.73 if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {74 return $post;75 }76 // Update the post meta with the new value.77 update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );78 }79 80 return $post;81 88 } 82 89 83 90 add_filter( 'attachment_fields_to_save', 'rtgodam_save_transcoded_url_field', 10, 2 ); 84 91 85 /** 86 * Register the transcoded URL meta field. 87 */ 88 function rtgodam_register_transcoded_url_meta() { 89 register_post_meta( 90 'attachment', 91 'rtgodam_transcoded_url', 92 array( 93 'type' => 'string', 94 'single' => true, 95 'show_in_rest' => true, 96 'auth_callback' => function () { 97 return current_user_can( 'edit_posts' ); 98 }, 99 ) 100 ); 92 93 if ( ! function_exists( 'rtgodam_register_transcoded_url_meta' ) ) { 94 95 /** 96 * Register the transcoded URL meta field. 97 */ 98 function rtgodam_register_transcoded_url_meta() { 99 register_post_meta( 100 'attachment', 101 'rtgodam_transcoded_url', 102 array( 103 'type' => 'string', 104 'single' => true, 105 'show_in_rest' => true, 106 'auth_callback' => function () { 107 return current_user_can( 'edit_posts' ); 108 }, 109 ) 110 ); 111 } 101 112 } 102 113 … … 105 116 106 117 107 if ( ! function_exists( 'rt t_set_video_thumbnail' ) ) {118 if ( ! function_exists( 'rtgodam_rtt_set_video_thumbnail' ) ) { 108 119 109 120 /** … … 114 125 * @param number $id rtMedia activity ID. 115 126 */ 116 function rt t_set_video_thumbnail( $id ) {127 function rtgodam_rtt_set_video_thumbnail( $id ) { 117 128 $media_type = rtmedia_type( $id ); 118 129 $attachment_id = rtmedia_media_id( $id ); // Get the wp attachment ID. … … 147 158 } 148 159 149 add_action( 'rtmedia_after_update_media', 'rt t_set_video_thumbnail', 12 );160 add_action( 'rtmedia_after_update_media', 'rtgodam_rtt_set_video_thumbnail', 12 ); 150 161 151 /**152 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity153 *154 * @since 1.0.7155 * @param string $thumb_url Video thumbnail URL.156 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set.157 */158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {159 if ( class_exists( 'RTMediaModel' ) ) {160 $model = new RTMediaModel();161 $media = $model->get( array( 'media_id' => $attachment_id ) );162 162 163 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 164 $attachment_id = $media[0]->media_id; 165 $media_type = $media[0]->media_type; 166 $cover_art = $media[0]->cover_art; 163 if ( ! function_exists( 'rtgodam_rtt_update_wp_media_thumbnail' ) ) { 167 164 168 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 169 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 165 /** 166 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity 167 * 168 * @since 1.0.7 169 * @param string $thumb_url Video thumbnail URL. 170 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set. 171 */ 172 function rtgodam_rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) { 173 if ( class_exists( 'RTMediaModel' ) ) { 174 $model = new RTMediaModel(); 175 $media = $model->get( array( 'media_id' => $attachment_id ) ); 176 177 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 178 $attachment_id = $media[0]->media_id; 179 $media_type = $media[0]->media_type; 180 $cover_art = $media[0]->cover_art; 181 182 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 183 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 184 } 170 185 } 171 186 } … … 173 188 } 174 189 175 add_action( 'rtgodam_transcoded_thumb_added', 'rt t_update_wp_media_thumbnail', 10, 2 );190 add_action( 'rtgodam_transcoded_thumb_added', 'rtgodam_rtt_update_wp_media_thumbnail', 10, 2 ); -
godam/tags/1.0.8/godam.php
r3298881 r3301420 4 4 * Plugin URI: https://godam.io 5 5 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration. 6 * Version: 1.0. 76 * Version: 1.0.8 7 7 * Text Domain: godam 8 8 * Author: rtCamp … … 42 42 * The version of the plugin 43 43 */ 44 define( 'RTGODAM_VERSION', '1.0. 7' );44 define( 'RTGODAM_VERSION', '1.0.8' ); 45 45 } 46 46 -
godam/tags/1.0.8/inc/classes/class-assets.php
r3298881 r3301420 50 50 RTGODAM_URL . 'assets/build/js/main.min.js', 51 51 array(), 52 filemtime( RTGODAM_PATH . ' /assets/build/js/main.min.js' ),52 filemtime( RTGODAM_PATH . 'assets/build/js/main.min.js' ), 53 53 true 54 54 ); … … 56 56 wp_register_style( 57 57 'rtgodam-style', 58 RTGODAM_URL . ' /assets/build/css/main.css',59 array(), 60 filemtime( RTGODAM_PATH . ' /assets/build/css/main.css' )58 RTGODAM_URL . 'assets/build/css/main.css', 59 array(), 60 filemtime( RTGODAM_PATH . 'assets/build/css/main.css' ) 61 61 ); 62 62 63 63 wp_enqueue_script( 64 64 'analytics-library', 65 RTGODAM_URL . ' /assets/src/libs/analytics.min.js',66 array(), 67 filemtime( RTGODAM_PATH . ' /assets/src/libs/analytics.min.js' ),65 RTGODAM_URL . 'assets/src/libs/analytics.min.js', 66 array(), 67 filemtime( RTGODAM_PATH . 'assets/src/libs/analytics.min.js' ), 68 68 true 69 69 ); … … 143 143 RTGODAM_URL . 'assets/build/js/admin.min.js', 144 144 array(), 145 filemtime( RTGODAM_PATH . ' /assets/build/js/admin.min.js' ),145 filemtime( RTGODAM_PATH . 'assets/build/js/admin.min.js' ), 146 146 true 147 147 ); … … 169 169 wp_register_style( 170 170 'rtgodam-style', 171 RTGODAM_URL . ' /assets/build/css/admin.css',172 array(), 173 filemtime( RTGODAM_PATH . ' /assets/build/css/admin.css' )171 RTGODAM_URL . 'assets/build/css/admin.css', 172 array(), 173 filemtime( RTGODAM_PATH . 'assets/build/css/admin.css' ) 174 174 ); 175 175 … … 183 183 RTGODAM_URL . 'assets/build/js/media-library.min.js', 184 184 array(), 185 filemtime( RTGODAM_PATH . ' /assets/build/js/media-library.min.js' ),185 filemtime( RTGODAM_PATH . 'assets/build/js/media-library.min.js' ), 186 186 true 187 187 ); … … 189 189 wp_register_style( 190 190 'easydam-media-library', 191 RTGODAM_URL . ' /assets/build/css/media-library.css',192 array(), 193 filemtime( RTGODAM_PATH . ' /assets/build/css/media-library.css' )191 RTGODAM_URL . 'assets/build/css/media-library.css', 192 array(), 193 filemtime( RTGODAM_PATH . 'assets/build/css/media-library.css' ) 194 194 ); 195 195 … … 240 240 * Dependency library for date range picker. 241 241 */ 242 wp_enqueue_script( 'moment-js', RTGODAM_URL . ' /assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/moment-js.min.js' ), true );243 wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . ' /assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.min.js' ), true );244 wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . ' /assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.css' ) );242 wp_enqueue_script( 'moment-js', RTGODAM_URL . 'assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/moment-js.min.js' ), true ); 243 wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . 'assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.min.js' ), true ); 244 wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . 'assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.css' ) ); 245 245 } 246 246 -
godam/tags/1.0.8/languages/godam.pot
r3298881 r3301420 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GoDAM 1.0. 7\n"5 "Project-Id-Version: GoDAM 1.0.8\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/godam\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05-2 2T13:33:19+00:00\n"12 "POT-Creation-Date: 2025-05-27T09:29:04+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 307 307 msgstr "" 308 308 309 #: admin/godam-transcoder-actions.php:4 2309 #: admin/godam-transcoder-actions.php:44 310 310 msgid "Transcoded CDN URL" 311 311 msgstr "" 312 312 313 #: admin/godam-transcoder-actions.php:4 6313 #: admin/godam-transcoder-actions.php:48 314 314 msgid "The URL of the transcoded file is generated automatically and cannot be edited." 315 315 msgstr "" … … 336 336 #: inc/classes/class-pages.php:116 337 337 #: assets/build/blocks/godam-audio/index.js:1 338 #: assets/build/blocks/godam-player/index.js: 3338 #: assets/build/blocks/godam-player/index.js:2 339 339 #: assets/src/blocks/godam-audio/edit.js:136 340 340 #: assets/src/blocks/godam-player/edit.js:321 … … 690 690 691 691 #: assets/build/blocks/godam-player/index.js:2 692 msgid "URL of the video content can be MOV, MP4, MPD. Example: https://www.example.com/video.mp4"693 msgstr ""694 695 #: assets/build/blocks/godam-player/index.js:2696 msgid "Title of the video"697 msgstr ""698 699 #: assets/build/blocks/godam-player/index.js:2700 msgid "Description of the video"701 msgstr ""702 703 #: assets/build/blocks/godam-player/index.js:2704 msgid "URL of the video thumbnail. Example: https://www.example.com/thumbnail.jpg"705 msgstr ""706 707 #: assets/build/blocks/godam-player/index.js:2708 msgid "Is the video suitable for all audiences?"709 msgstr ""710 711 #: assets/build/blocks/godam-player/index.js:2712 #: pages/video-editor/components/layers/AdsLayer.js:59713 #: pages/video-editor/components/layers/CTALayer.js:153714 #: pages/video-editor/components/layers/FormLayer.js:97715 #: pages/video-editor/components/layers/HotspotLayer.js:160716 #: pages/video-editor/components/layers/PollLayer.js:55717 #: pages/video-editor/components/LayerSelector.jsx:130718 msgid "Cancel"719 msgstr ""720 721 #: assets/build/blocks/godam-player/index.js:2722 #: pages/video-editor/VideoEditor.js:191723 msgid "Save"724 msgstr ""725 726 #. translators: %s: Label of the video text track e.g: "French subtitles".727 #: assets/build/blocks/godam-player/index.js:3728 692 #: assets/src/blocks/godam-player/edit.js:263 729 693 msgid "GoDAM video" 730 694 msgstr "" 731 695 732 #: assets/build/blocks/godam-player/index.js: 3696 #: assets/build/blocks/godam-player/index.js:2 733 697 #: assets/src/blocks/godam-player/edit.js:264 734 698 msgid "Drag and drop a video, upload, or choose from your library." 735 699 msgstr "" 736 700 737 #: assets/build/blocks/godam-player/index.js: 3701 #: assets/build/blocks/godam-player/index.js:2 738 702 #: assets/src/blocks/godam-player/edit.js:329 739 703 msgid "Poster image" 740 704 msgstr "" 741 705 742 #: assets/build/blocks/godam-player/index.js: 3706 #: assets/build/blocks/godam-player/index.js:2 743 707 #: assets/src/blocks/godam-player/edit.js:332 744 708 msgid "Select poster image" 745 709 msgstr "" 746 710 747 #: assets/build/blocks/godam-player/index.js: 3711 #: assets/build/blocks/godam-player/index.js:2 748 712 #: assets/src/blocks/godam-player/edit.js:343 749 713 #: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:47 … … 754 718 msgstr "" 755 719 756 #: assets/build/blocks/godam-player/index.js: 3720 #: assets/build/blocks/godam-player/index.js:2 757 721 #: assets/src/blocks/godam-player/edit.js:343 758 722 msgid "Select" … … 760 724 761 725 #. translators: %s: poster image URL. 762 #: assets/build/blocks/godam-player/index.js: 4726 #: assets/build/blocks/godam-player/index.js:3 763 727 #: assets/src/blocks/godam-player/edit.js:351 764 728 msgid "The current poster image url is %s" 765 729 msgstr "" 766 730 767 #: assets/build/blocks/godam-player/index.js: 4731 #: assets/build/blocks/godam-player/index.js:3 768 732 #: assets/src/blocks/godam-player/edit.js:354 769 733 msgid "There is no poster image currently selected" 770 734 msgstr "" 771 735 772 #: assets/build/blocks/godam-player/index.js: 4736 #: assets/build/blocks/godam-player/index.js:3 773 737 #: assets/src/blocks/godam-player/edit.js:362 774 738 #: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:56 … … 778 742 msgstr "" 779 743 780 #: assets/build/blocks/godam-player/index.js: 4744 #: assets/build/blocks/godam-player/index.js:3 781 745 #: assets/src/blocks/godam-player/edit.js:369 782 746 msgid "Customise Video" 783 747 msgstr "" 784 748 785 #: assets/build/blocks/godam-player/index.js: 4749 #: assets/build/blocks/godam-player/index.js:3 786 750 #: assets/src/blocks/godam-player/edit.js:380 787 751 msgid "Customise" 788 752 msgstr "" 789 753 790 #: assets/build/blocks/godam-player/index.js:4 791 msgid "SEO Settings" 792 msgstr "" 793 794 #: assets/build/blocks/godam-player/index.js:4 754 #: assets/build/blocks/godam-player/index.js:3 795 755 #: assets/src/blocks/godam-player/edit.js:394 796 756 msgid "Video caption text" … … 1378 1338 msgstr "" 1379 1339 1340 #: pages/video-editor/components/layers/AdsLayer.js:59 1341 #: pages/video-editor/components/layers/CTALayer.js:153 1342 #: pages/video-editor/components/layers/FormLayer.js:97 1343 #: pages/video-editor/components/layers/HotspotLayer.js:160 1344 #: pages/video-editor/components/layers/PollLayer.js:55 1345 #: pages/video-editor/components/LayerSelector.jsx:130 1346 msgid "Cancel" 1347 msgstr "" 1348 1380 1349 #: pages/video-editor/components/layers/AdsLayer.js:72 1381 1350 msgid "Self hosted video Ad" … … 1647 1616 msgstr "" 1648 1617 1618 #: pages/video-editor/VideoEditor.js:191 1619 msgid "Save" 1620 msgstr "" 1621 1649 1622 #: pages/video-editor/VideoEditor.js:201 1650 1623 msgid "Video changes saved successfully" -
godam/tags/1.0.8/readme.txt
r3298881 r3301420 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 77 Stable tag: 1.0.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 18 18 Check out our source code and contribute to the plugin on GitHub: [Official GoDAM GitHub](https://github.com/rtCamp/godam). 19 Read our blog: [GoDAM blog](https:// rtcamp.com/blog/godam/)19 Read our blog: [GoDAM blog](https://godam.io/blog/) 20 20 21 21 [youtube https://www.youtube.com/watch?v=UGmKa6aLSgU] … … 147 147 == Changelog == 148 148 149 = v1.0.8 (May 27, 2025) = 150 - Renamed functions and added checks for function existence to prevent fatal errors caused by other plugin functions. 151 149 152 = v1.0.7 (May 22, 2025) = 150 153 - Fix: Update the POT creation process for translation. -
godam/trunk/admin/godam-transcoder-actions.php
r3294292 r3301420 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 /** 14 * Add a field for the transcoded URL to the media attachment edit screen. 15 * 16 * @param array $form_fields An array of attachment form fields. 17 * @param object $post The attachment post object. 18 * @return array The modified array of attachment form fields. 19 */ 20 function rtgodam_add_transcoded_url_field( $form_fields, $post ) { 13 if ( ! function_exists( 'rtgodam_add_transcoded_url_field' ) ) { 21 14 22 // Check if post is of type attachment. 23 if ( 'attachment' !== $post->post_type ) { 15 /** 16 * Add a field for the transcoded URL to the media attachment edit screen. 17 * 18 * @param array $form_fields An array of attachment form fields. 19 * @param object $post The attachment post object. 20 * @return array The modified array of attachment form fields. 21 */ 22 function rtgodam_add_transcoded_url_field( $form_fields, $post ) { 23 24 // Check if post is of type attachment. 25 if ( 'attachment' !== $post->post_type ) { 26 return $form_fields; 27 } 28 29 // Check if attachment is of type video. 30 $mime_type = get_post_mime_type( $post->ID ); 31 32 if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) { 33 return $form_fields; 34 } 35 36 $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true ); 37 38 $easydam_settings = get_option( 'rtgodam-settings', array() ); 39 40 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 41 42 // Add the transcoded URL field. 43 $form_fields['transcoded_url'] = array( 44 'label' => __( 'Transcoded CDN URL', 'godam' ), 45 'input' => 'html', 46 'html' => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>', 47 'value' => esc_url( $transcoded_url ), 48 'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ), 49 ); 50 24 51 return $form_fields; 25 52 } 26 27 // Check if attachment is of type video.28 $mime_type = get_post_mime_type( $post->ID );29 30 if ( ! preg_match( '/^(video|audio)\//', $mime_type ) ) {31 return $form_fields;32 }33 34 $transcoded_url = get_post_meta( $post->ID, 'rtgodam_transcoded_url', true );35 36 $easydam_settings = get_option( 'rtgodam-settings', array() );37 38 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] );39 40 // Add the transcoded URL field.41 $form_fields['transcoded_url'] = array(42 'label' => __( 'Transcoded CDN URL', 'godam' ),43 'input' => 'html',44 'html' => '<input type="text" name="attachments[' . $post->ID . '][transcoded_url]" id="attachments-' . $post->ID . '-transcoded_url" value="' . esc_url( $transcoded_url ) . '" readonly>',45 'value' => esc_url( $transcoded_url ),46 'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),47 );48 49 return $form_fields;50 53 } 51 54 52 55 add_filter( 'attachment_fields_to_edit', 'rtgodam_add_transcoded_url_field', 10, 2 ); 53 56 54 /**55 * Save the transcoded URL field when the attachment is saved.56 *57 * @param array $post The post data for the attachment.58 * @param array $attachment The attachment data.59 * @return array The post data for the attachment.60 */61 function rtgodam_save_transcoded_url_field( $post, $attachment ) {62 // Check if adaptive bitrate streaming is enabled.63 $easydam_settings = get_option( 'rtgodam-settings', array() );64 57 65 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 58 if ( ! function_exists( 'rtgodam_save_transcoded_url_field' ) ) { 66 59 67 if ( ! $adaptive_bitrate_enabled ) { 60 /** 61 * Save the transcoded URL field when the attachment is saved. 62 * 63 * @param array $post The post data for the attachment. 64 * @param array $attachment The attachment data. 65 * @return array The post data for the attachment. 66 */ 67 function rtgodam_save_transcoded_url_field( $post, $attachment ) { 68 // Check if adaptive bitrate streaming is enabled. 69 $easydam_settings = get_option( 'rtgodam-settings', array() ); 70 71 $adaptive_bitrate_enabled = ! empty( $easydam_settings['video']['adaptive_bitrate'] ); 72 73 if ( ! $adaptive_bitrate_enabled ) { 74 return $post; 75 } 76 77 if ( isset( $attachment['transcoded_url'] ) ) { 78 // Check the user's permissions. 79 if ( ! current_user_can( 'edit_post', $post['ID'] ) ) { 80 return $post; 81 } 82 // Update the post meta with the new value. 83 update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) ); 84 } 85 68 86 return $post; 69 87 } 70 71 if ( isset( $attachment['transcoded_url'] ) ) {72 // Check the user's permissions.73 if ( ! current_user_can( 'edit_post', $post['ID'] ) ) {74 return $post;75 }76 // Update the post meta with the new value.77 update_post_meta( $post['ID'], 'rtgodam_transcoded_url', esc_url_raw( $attachment['transcoded_url'] ) );78 }79 80 return $post;81 88 } 82 89 83 90 add_filter( 'attachment_fields_to_save', 'rtgodam_save_transcoded_url_field', 10, 2 ); 84 91 85 /** 86 * Register the transcoded URL meta field. 87 */ 88 function rtgodam_register_transcoded_url_meta() { 89 register_post_meta( 90 'attachment', 91 'rtgodam_transcoded_url', 92 array( 93 'type' => 'string', 94 'single' => true, 95 'show_in_rest' => true, 96 'auth_callback' => function () { 97 return current_user_can( 'edit_posts' ); 98 }, 99 ) 100 ); 92 93 if ( ! function_exists( 'rtgodam_register_transcoded_url_meta' ) ) { 94 95 /** 96 * Register the transcoded URL meta field. 97 */ 98 function rtgodam_register_transcoded_url_meta() { 99 register_post_meta( 100 'attachment', 101 'rtgodam_transcoded_url', 102 array( 103 'type' => 'string', 104 'single' => true, 105 'show_in_rest' => true, 106 'auth_callback' => function () { 107 return current_user_can( 'edit_posts' ); 108 }, 109 ) 110 ); 111 } 101 112 } 102 113 … … 105 116 106 117 107 if ( ! function_exists( 'rt t_set_video_thumbnail' ) ) {118 if ( ! function_exists( 'rtgodam_rtt_set_video_thumbnail' ) ) { 108 119 109 120 /** … … 114 125 * @param number $id rtMedia activity ID. 115 126 */ 116 function rt t_set_video_thumbnail( $id ) {127 function rtgodam_rtt_set_video_thumbnail( $id ) { 117 128 $media_type = rtmedia_type( $id ); 118 129 $attachment_id = rtmedia_media_id( $id ); // Get the wp attachment ID. … … 147 158 } 148 159 149 add_action( 'rtmedia_after_update_media', 'rt t_set_video_thumbnail', 12 );160 add_action( 'rtmedia_after_update_media', 'rtgodam_rtt_set_video_thumbnail', 12 ); 150 161 151 /**152 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity153 *154 * @since 1.0.7155 * @param string $thumb_url Video thumbnail URL.156 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set.157 */158 function rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) {159 if ( class_exists( 'RTMediaModel' ) ) {160 $model = new RTMediaModel();161 $media = $model->get( array( 'media_id' => $attachment_id ) );162 162 163 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 164 $attachment_id = $media[0]->media_id; 165 $media_type = $media[0]->media_type; 166 $cover_art = $media[0]->cover_art; 163 if ( ! function_exists( 'rtgodam_rtt_update_wp_media_thumbnail' ) ) { 167 164 168 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 169 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 165 /** 166 * Set the cover art/video thumbnail for the videos which are not uploaded from the rtMedia activity 167 * 168 * @since 1.0.7 169 * @param string $thumb_url Video thumbnail URL. 170 * @param int $attachment_id Attachment ID of the media/video for which thumbnail has to be set. 171 */ 172 function rtgodam_rtt_update_wp_media_thumbnail( $thumb_url, $attachment_id ) { 173 if ( class_exists( 'RTMediaModel' ) ) { 174 $model = new RTMediaModel(); 175 $media = $model->get( array( 'media_id' => $attachment_id ) ); 176 177 if ( ! empty( $media ) && ! empty( $media[0] ) ) { 178 $attachment_id = $media[0]->media_id; 179 $media_type = $media[0]->media_type; 180 $cover_art = $media[0]->cover_art; 181 182 if ( 'video' === $media_type && empty( $cover_art ) && ! empty( $thumb_url ) ) { 183 $model->update( array( 'cover_art' => $thumb_url ), array( 'media_id' => $attachment_id ) ); 184 } 170 185 } 171 186 } … … 173 188 } 174 189 175 add_action( 'rtgodam_transcoded_thumb_added', 'rt t_update_wp_media_thumbnail', 10, 2 );190 add_action( 'rtgodam_transcoded_thumb_added', 'rtgodam_rtt_update_wp_media_thumbnail', 10, 2 ); -
godam/trunk/godam.php
r3298881 r3301420 4 4 * Plugin URI: https://godam.io 5 5 * Description: Seamlessly manage and optimize digital assets with GoDAM – featuring transcoding, adaptive streaming, interactive video layers, gravity forms integration, and ad integration. 6 * Version: 1.0. 76 * Version: 1.0.8 7 7 * Text Domain: godam 8 8 * Author: rtCamp … … 42 42 * The version of the plugin 43 43 */ 44 define( 'RTGODAM_VERSION', '1.0. 7' );44 define( 'RTGODAM_VERSION', '1.0.8' ); 45 45 } 46 46 -
godam/trunk/inc/classes/class-assets.php
r3298881 r3301420 50 50 RTGODAM_URL . 'assets/build/js/main.min.js', 51 51 array(), 52 filemtime( RTGODAM_PATH . ' /assets/build/js/main.min.js' ),52 filemtime( RTGODAM_PATH . 'assets/build/js/main.min.js' ), 53 53 true 54 54 ); … … 56 56 wp_register_style( 57 57 'rtgodam-style', 58 RTGODAM_URL . ' /assets/build/css/main.css',59 array(), 60 filemtime( RTGODAM_PATH . ' /assets/build/css/main.css' )58 RTGODAM_URL . 'assets/build/css/main.css', 59 array(), 60 filemtime( RTGODAM_PATH . 'assets/build/css/main.css' ) 61 61 ); 62 62 63 63 wp_enqueue_script( 64 64 'analytics-library', 65 RTGODAM_URL . ' /assets/src/libs/analytics.min.js',66 array(), 67 filemtime( RTGODAM_PATH . ' /assets/src/libs/analytics.min.js' ),65 RTGODAM_URL . 'assets/src/libs/analytics.min.js', 66 array(), 67 filemtime( RTGODAM_PATH . 'assets/src/libs/analytics.min.js' ), 68 68 true 69 69 ); … … 143 143 RTGODAM_URL . 'assets/build/js/admin.min.js', 144 144 array(), 145 filemtime( RTGODAM_PATH . ' /assets/build/js/admin.min.js' ),145 filemtime( RTGODAM_PATH . 'assets/build/js/admin.min.js' ), 146 146 true 147 147 ); … … 169 169 wp_register_style( 170 170 'rtgodam-style', 171 RTGODAM_URL . ' /assets/build/css/admin.css',172 array(), 173 filemtime( RTGODAM_PATH . ' /assets/build/css/admin.css' )171 RTGODAM_URL . 'assets/build/css/admin.css', 172 array(), 173 filemtime( RTGODAM_PATH . 'assets/build/css/admin.css' ) 174 174 ); 175 175 … … 183 183 RTGODAM_URL . 'assets/build/js/media-library.min.js', 184 184 array(), 185 filemtime( RTGODAM_PATH . ' /assets/build/js/media-library.min.js' ),185 filemtime( RTGODAM_PATH . 'assets/build/js/media-library.min.js' ), 186 186 true 187 187 ); … … 189 189 wp_register_style( 190 190 'easydam-media-library', 191 RTGODAM_URL . ' /assets/build/css/media-library.css',192 array(), 193 filemtime( RTGODAM_PATH . ' /assets/build/css/media-library.css' )191 RTGODAM_URL . 'assets/build/css/media-library.css', 192 array(), 193 filemtime( RTGODAM_PATH . 'assets/build/css/media-library.css' ) 194 194 ); 195 195 … … 240 240 * Dependency library for date range picker. 241 241 */ 242 wp_enqueue_script( 'moment-js', RTGODAM_URL . ' /assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/moment-js.min.js' ), true );243 wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . ' /assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.min.js' ), true );244 wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . ' /assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . '/assets/src/libs/daterangepicker.css' ) );242 wp_enqueue_script( 'moment-js', RTGODAM_URL . 'assets/src/libs/moment-js.min.js', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/moment-js.min.js' ), true ); 243 wp_enqueue_script( 'daterangepicker-js', RTGODAM_URL . 'assets/src/libs/daterangepicker.min.js', array( 'moment-js' ), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.min.js' ), true ); 244 wp_enqueue_style( 'daterangepicker-css', RTGODAM_URL . 'assets/src/libs/daterangepicker.css', array(), filemtime( RTGODAM_PATH . 'assets/src/libs/daterangepicker.css' ) ); 245 245 } 246 246 -
godam/trunk/languages/godam.pot
r3298881 r3301420 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: GoDAM 1.0. 7\n"5 "Project-Id-Version: GoDAM 1.0.8\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/godam\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2025-05-2 2T13:33:19+00:00\n"12 "POT-Creation-Date: 2025-05-27T09:29:04+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.11.0\n" … … 307 307 msgstr "" 308 308 309 #: admin/godam-transcoder-actions.php:4 2309 #: admin/godam-transcoder-actions.php:44 310 310 msgid "Transcoded CDN URL" 311 311 msgstr "" 312 312 313 #: admin/godam-transcoder-actions.php:4 6313 #: admin/godam-transcoder-actions.php:48 314 314 msgid "The URL of the transcoded file is generated automatically and cannot be edited." 315 315 msgstr "" … … 336 336 #: inc/classes/class-pages.php:116 337 337 #: assets/build/blocks/godam-audio/index.js:1 338 #: assets/build/blocks/godam-player/index.js: 3338 #: assets/build/blocks/godam-player/index.js:2 339 339 #: assets/src/blocks/godam-audio/edit.js:136 340 340 #: assets/src/blocks/godam-player/edit.js:321 … … 690 690 691 691 #: assets/build/blocks/godam-player/index.js:2 692 msgid "URL of the video content can be MOV, MP4, MPD. Example: https://www.example.com/video.mp4"693 msgstr ""694 695 #: assets/build/blocks/godam-player/index.js:2696 msgid "Title of the video"697 msgstr ""698 699 #: assets/build/blocks/godam-player/index.js:2700 msgid "Description of the video"701 msgstr ""702 703 #: assets/build/blocks/godam-player/index.js:2704 msgid "URL of the video thumbnail. Example: https://www.example.com/thumbnail.jpg"705 msgstr ""706 707 #: assets/build/blocks/godam-player/index.js:2708 msgid "Is the video suitable for all audiences?"709 msgstr ""710 711 #: assets/build/blocks/godam-player/index.js:2712 #: pages/video-editor/components/layers/AdsLayer.js:59713 #: pages/video-editor/components/layers/CTALayer.js:153714 #: pages/video-editor/components/layers/FormLayer.js:97715 #: pages/video-editor/components/layers/HotspotLayer.js:160716 #: pages/video-editor/components/layers/PollLayer.js:55717 #: pages/video-editor/components/LayerSelector.jsx:130718 msgid "Cancel"719 msgstr ""720 721 #: assets/build/blocks/godam-player/index.js:2722 #: pages/video-editor/VideoEditor.js:191723 msgid "Save"724 msgstr ""725 726 #. translators: %s: Label of the video text track e.g: "French subtitles".727 #: assets/build/blocks/godam-player/index.js:3728 692 #: assets/src/blocks/godam-player/edit.js:263 729 693 msgid "GoDAM video" 730 694 msgstr "" 731 695 732 #: assets/build/blocks/godam-player/index.js: 3696 #: assets/build/blocks/godam-player/index.js:2 733 697 #: assets/src/blocks/godam-player/edit.js:264 734 698 msgid "Drag and drop a video, upload, or choose from your library." 735 699 msgstr "" 736 700 737 #: assets/build/blocks/godam-player/index.js: 3701 #: assets/build/blocks/godam-player/index.js:2 738 702 #: assets/src/blocks/godam-player/edit.js:329 739 703 msgid "Poster image" 740 704 msgstr "" 741 705 742 #: assets/build/blocks/godam-player/index.js: 3706 #: assets/build/blocks/godam-player/index.js:2 743 707 #: assets/src/blocks/godam-player/edit.js:332 744 708 msgid "Select poster image" 745 709 msgstr "" 746 710 747 #: assets/build/blocks/godam-player/index.js: 3711 #: assets/build/blocks/godam-player/index.js:2 748 712 #: assets/src/blocks/godam-player/edit.js:343 749 713 #: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:47 … … 754 718 msgstr "" 755 719 756 #: assets/build/blocks/godam-player/index.js: 3720 #: assets/build/blocks/godam-player/index.js:2 757 721 #: assets/src/blocks/godam-player/edit.js:343 758 722 msgid "Select" … … 760 724 761 725 #. translators: %s: poster image URL. 762 #: assets/build/blocks/godam-player/index.js: 4726 #: assets/build/blocks/godam-player/index.js:3 763 727 #: assets/src/blocks/godam-player/edit.js:351 764 728 msgid "The current poster image url is %s" 765 729 msgstr "" 766 730 767 #: assets/build/blocks/godam-player/index.js: 4731 #: assets/build/blocks/godam-player/index.js:3 768 732 #: assets/src/blocks/godam-player/edit.js:354 769 733 msgid "There is no poster image currently selected" 770 734 msgstr "" 771 735 772 #: assets/build/blocks/godam-player/index.js: 4736 #: assets/build/blocks/godam-player/index.js:3 773 737 #: assets/src/blocks/godam-player/edit.js:362 774 738 #: pages/godam/components/tabs/GeneralSettings/BrandImageSelector.jsx:56 … … 778 742 msgstr "" 779 743 780 #: assets/build/blocks/godam-player/index.js: 4744 #: assets/build/blocks/godam-player/index.js:3 781 745 #: assets/src/blocks/godam-player/edit.js:369 782 746 msgid "Customise Video" 783 747 msgstr "" 784 748 785 #: assets/build/blocks/godam-player/index.js: 4749 #: assets/build/blocks/godam-player/index.js:3 786 750 #: assets/src/blocks/godam-player/edit.js:380 787 751 msgid "Customise" 788 752 msgstr "" 789 753 790 #: assets/build/blocks/godam-player/index.js:4 791 msgid "SEO Settings" 792 msgstr "" 793 794 #: assets/build/blocks/godam-player/index.js:4 754 #: assets/build/blocks/godam-player/index.js:3 795 755 #: assets/src/blocks/godam-player/edit.js:394 796 756 msgid "Video caption text" … … 1378 1338 msgstr "" 1379 1339 1340 #: pages/video-editor/components/layers/AdsLayer.js:59 1341 #: pages/video-editor/components/layers/CTALayer.js:153 1342 #: pages/video-editor/components/layers/FormLayer.js:97 1343 #: pages/video-editor/components/layers/HotspotLayer.js:160 1344 #: pages/video-editor/components/layers/PollLayer.js:55 1345 #: pages/video-editor/components/LayerSelector.jsx:130 1346 msgid "Cancel" 1347 msgstr "" 1348 1380 1349 #: pages/video-editor/components/layers/AdsLayer.js:72 1381 1350 msgid "Self hosted video Ad" … … 1647 1616 msgstr "" 1648 1617 1618 #: pages/video-editor/VideoEditor.js:191 1619 msgid "Save" 1620 msgstr "" 1621 1649 1622 #: pages/video-editor/VideoEditor.js:201 1650 1623 msgid "Video changes saved successfully" -
godam/trunk/readme.txt
r3298881 r3301420 5 5 Tested up to: 6.8.1 6 6 Requires PHP: 7.4 7 Stable tag: 1.0. 77 Stable tag: 1.0.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 18 18 Check out our source code and contribute to the plugin on GitHub: [Official GoDAM GitHub](https://github.com/rtCamp/godam). 19 Read our blog: [GoDAM blog](https:// rtcamp.com/blog/godam/)19 Read our blog: [GoDAM blog](https://godam.io/blog/) 20 20 21 21 [youtube https://www.youtube.com/watch?v=UGmKa6aLSgU] … … 147 147 == Changelog == 148 148 149 = v1.0.8 (May 27, 2025) = 150 - Renamed functions and added checks for function existence to prevent fatal errors caused by other plugin functions. 151 149 152 = v1.0.7 (May 22, 2025) = 150 153 - Fix: Update the POT creation process for translation.
Note: See TracChangeset
for help on using the changeset viewer.