Skip to content
Merged
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog #

## v1.3.4 (August 11, 2025) ##

- Fix: Video Editor UI issues

## v1.3.3 (August 11, 2025) ##

- Tweak: Improved video player controls and HLS URL handling
- Tweak: Added Video SEO support and duplicate prevention for GoDAM Tab videos
- Tweak: Player-specific video speed and quality settings
- Fix: Resolved share button and JavaScript registration issues

## v1.3.2 (August 6, 2025) ##

- Fix: Resolved PHP Warning on admin pages
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![Banner V3](https://github.com/user-attachments/assets/73cfb2c2-0779-44c2-85e7-67e812dd82b6)

# GoDAM - Organize WordPress Media Library & File Manager with Unlimited Folders for Images, Videos & more
Contributors: [rtcamp](https://profiles.wordpress.org/rtcamp), [elifvish](https://profiles.wordpress.org/elifvish), [subodhrajpopat](https://profiles.wordpress.org/subodhrajpopat), [kuldipchaudhary](https://profiles.wordpress.org/kuldipchaudhary), [prachigarg19](https://profiles.wordpress.org/prachigarg19), [juzar](https://profiles.wordpress.org/juzar), [geekofshire](https://profiles.wordpress.org/geekofshire), [nazmulhassann20](https://profiles.wordpress.org/nazmulhassann20), [abhinavbelhekar03](https://profiles.wordpress.org/abhinavbelhekar03), [gautam23](https://profiles.wordpress.org/gautam23)
Contributors: [rtcamp](https://profiles.wordpress.org/rtcamp), [elifvish](https://profiles.wordpress.org/elifvish), [subodhrajpopat](https://profiles.wordpress.org/subodhrajpopat), [kuldipchaudhary](https://profiles.wordpress.org/kuldipchaudhary), [prachigarg19](https://profiles.wordpress.org/prachigarg19), [juzar](https://profiles.wordpress.org/juzar), [geekofshire](https://profiles.wordpress.org/geekofshire), [nazmulhassann20](https://profiles.wordpress.org/nazmulhassann20), [abhinavbelhekar03](https://profiles.wordpress.org/abhinavbelhekar03), [gautam23](https://profiles.wordpress.org/gautam23), [mukulsingh27](https://profiles.wordpress.org/mukulsingh27), [hbhalodia](https://profiles.wordpress.org/hbhalodia)

Tags: transcoder, video, media library, folders, file manager

Expand All @@ -11,7 +11,7 @@ Tested up to: 6.8.1

Requires PHP: 7.4

Stable tag: 1.3.2
Stable tag: 1.3.4

License: [GPLv2 or later](http://www.gnu.org/licenses/gpl-2.0.html)

Expand Down
27 changes: 15 additions & 12 deletions admin/godam-transcoder-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,21 @@ function rtgodam_add_transcoded_url_field( $form_fields, $post ) {
'helps' => __( 'The URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
);

$form_fields['hls_transcoded_url'] = array(
'label' => __( 'Transcoded CDN URL (HLS)', 'godam' ),
'input' => 'html',
'html' => sprintf(
'<input type="text" class="widefat" name="attachments[%d][hls_transcoded_url]" id="attachments-%d-hls-transcoded_url" value="%s" readonly>',
(int) $post->ID,
(int) $post->ID,
esc_url( $hls_transcoded_url )
),
'value' => esc_url( $hls_transcoded_url ),
'helps' => __( 'The HLS URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
);
// Show the HLS transcoded URL field only for video files.
if ( strpos( $mime_type, 'video/' ) === 0 ) {
$form_fields['hls_transcoded_url'] = array(
'label' => __( 'Transcoded CDN URL (HLS)', 'godam' ),
'input' => 'html',
'html' => sprintf(
'<input type="text" class="widefat" name="attachments[%d][hls_transcoded_url]" id="attachments-%d-hls-transcoded_url" value="%s" readonly>',
(int) $post->ID,
(int) $post->ID,
esc_url( $hls_transcoded_url )
),
'value' => esc_url( $hls_transcoded_url ),
'helps' => __( 'The HLS URL of the transcoded file is generated automatically and cannot be edited.', 'godam' ),
);
}
} else {
// Display locked field with upsell message for free users.
$form_fields['transcoded_url'] = array(
Expand Down
33 changes: 22 additions & 11 deletions assets/src/blocks/godam-player/components/VideoSEOModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,32 @@ import { __ } from '@wordpress/i18n';
* Internal dependencies
*/
import './video-seo-modal.scss';
import { getFirstNonEmpty, appendTimezoneOffsetToUTC, isObjectEmpty } from '../utils';
import { isObjectEmpty } from '../utils';

export default function VideoSEOModal( { isOpen, setIsOpen, attachmentData, attributes, setAttributes } ) {
/**
* Video SEO Modal component
*
* @param {*} param0
* @param {boolean} param0.isOpen - Whether the modal is open
* @param {Function} param0.setIsOpen - Function to set modal open state
* @param {Object} param0.attributes - Block attributes
* @param {Function} param0.setAttributes - Function to set block attributes
*
* @return {JSX.Element|null} returns the Video SEO Modal component or null if not open
*/
export default function VideoSEOModal( { isOpen, setIsOpen, attributes, setAttributes } ) {
const [ videoData, setVideoData ] = useState( {} );

useEffect( () => {
if ( attachmentData && ! isObjectEmpty( attachmentData ) ) {
if ( attributes.seo && ! isObjectEmpty( attributes.seo ) ) {
const initialVideoData = {
contentUrl: getFirstNonEmpty( attributes?.seo?.contentUrl, attachmentData?.meta?.rtgodam_transcoded_url, attachmentData?.source_url ),
headline: getFirstNonEmpty( attributes?.seo?.headline, attachmentData?.title?.rendered ),
description: getFirstNonEmpty( attributes?.seo?.description, attachmentData?.description?.rendered ),
uploadDate: getFirstNonEmpty( attributes?.seo?.uploadDate, appendTimezoneOffsetToUTC( attachmentData?.date_gmt ) ),
duration: getFirstNonEmpty( attributes?.seo?.duration, attachmentData?.video_duration_iso8601 ),
thumbnailUrl: getFirstNonEmpty( attributes?.seo?.thumbnailUrl, attachmentData?.meta?.rtgodam_media_video_thumbnail ),
isFamilyFriendly: getFirstNonEmpty( attributes?.seo?.isFamilyFriendly, true ),
contentUrl: attributes?.seo?.contentUrl || '',
headline: attributes?.seo?.headline || '',
description: attributes?.seo?.description || '',
uploadDate: attributes?.seo?.uploadDate || '',
duration: attributes?.seo?.duration || '',
thumbnailUrl: attributes?.seo?.thumbnailUrl || '',
isFamilyFriendly: attributes?.seo?.isFamilyFriendly || true,
};

setVideoData( initialVideoData );
Expand All @@ -46,7 +57,7 @@ export default function VideoSEOModal( { isOpen, setIsOpen, attachmentData, attr
} );
}
}
}, [ attachmentData, attributes, setAttributes ] ); // Remove isOpen from dependencies
}, [ attributes, setAttributes ] ); // Remove isOpen from dependencies

const updateField = ( field, value ) => {
setVideoData( { ...videoData, [ field ]: value } );
Expand Down
106 changes: 68 additions & 38 deletions assets/src/blocks/godam-player/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import Video from './VideoJS';
import TracksEditor from './track-uploader';
import { Caption } from './caption';
import VideoSEOModal from './components/VideoSEOModal.js';
import { appendTimezoneOffsetToUTC, secondsToISO8601 } from './utils/index.js';

const ALLOWED_MEDIA_TYPES = [ 'video' ];
const VIDEO_POSTER_ALLOWED_MEDIA_TYPES = [ 'image' ];
Expand Down Expand Up @@ -106,7 +107,6 @@ function VideoEdit( {
const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
const [ defaultPoster, setDefaultPoster ] = useState( '' );
const [ isSEOModalOpen, setIsSEOModelOpen ] = useState( false );
const [ videoResponse, setVideoResponse ] = useState( {} );
const [ duration, setDuration ] = useState( 0 );

const dispatch = useDispatch();
Expand Down Expand Up @@ -167,8 +167,6 @@ function VideoEdit( {
try {
const response = await apiFetch( { path: `/wp/v2/media/${ id }` } );

setVideoResponse( response );

if ( response.meta.rtgodam_media_video_thumbnail !== '' ) {
setDefaultPoster( response.meta.rtgodam_media_video_thumbnail );
}
Expand Down Expand Up @@ -252,54 +250,87 @@ function VideoEdit( {
setDefaultPoster( media.image?.src );
}

if ( media?.origin === 'godam' ) {
setAttributes( {
seo: {
contentUrl: media?.url,
headline: media?.title || '',
description: media?.description || '',
uploadDate: appendTimezoneOffsetToUTC( media?.date || '' ),
duration: secondsToISO8601( media?.duration || '' ),
thumbnailUrl: media?.thumbnail_url || '',
isFamilyFriendly: true, // Default value
},
} );

setAttributes( {
sources: [
{
src: media.url,
type: media.url.endsWith( '.mov' ) ? 'video/mp4' : media.mime,
},
],
} );
} else {
// Fetch transcoded URL from media meta.
( async () => {
try {
const response = await apiFetch( { path: `/wp/v2/media/${ media.id }` } );
( async () => {
try {
const response = await apiFetch( { path: `/wp/v2/media/${ media.id }` } );

setVideoResponse( response );
setAttributes( {
seo: {
contentUrl: response.meta?.rtgodam_transcoded_url || response.source_url,
headline: response.title?.rendered || '',
description: response.description?.rendered || '',
uploadDate: appendTimezoneOffsetToUTC( response.date_gmt ),
duration: response.video_duration_iso8601 || '',
thumbnailUrl: response.meta?.rtgodam_media_video_thumbnail || '',
isFamilyFriendly: true, // Default value
},
} );

if ( response && response.meta && response.meta.rtgodam_transcoded_url ) {
const transcodedUrl = response.meta.rtgodam_transcoded_url;
if ( response && response.meta && response.meta.rtgodam_transcoded_url ) {
const transcodedUrl = response.meta.rtgodam_transcoded_url;

if ( response.meta.rtgodam_media_video_thumbnail !== '' ) {
setDefaultPoster( response.meta.rtgodam_media_video_thumbnail );
}
if ( response.meta.rtgodam_media_video_thumbnail !== '' ) {
setDefaultPoster( response.meta.rtgodam_media_video_thumbnail );
}

setAttributes( {
sources: [
{
src: transcodedUrl,
type: transcodedUrl.endsWith( '.mpd' ) ? 'application/dash+xml' : media.mime,
},
{
src: media.url,
type: media.url.endsWith( '.mov' ) ? 'video/mp4' : media.mime,
},
],
} );
} else {
setAttributes( {
sources: [
{
src: transcodedUrl,
type: transcodedUrl.endsWith( '.mpd' ) ? 'application/dash+xml' : media.mime,
},
{
src: media.url,
type: media.url.endsWith( '.mov' ) ? 'video/mp4' : media.mime,
},
],
} );
} else {
// If meta not present, use media url.
setAttributes( {
sources: [
{
src: media.url,
type: media.url.endsWith( '.mov' ) ? 'video/mp4' : media.mime,
},
],
} );
}
} catch ( error ) {
setAttributes( {
sources: [
{
src: media.url,
type: media.url.endsWith( '.mov' ) ? 'video/mp4' : media.mime,
type: media.mime,
},
],
} );
}
} catch ( error ) {
setAttributes( {
sources: [
{
src: media.url,
type: media.mime,
},
],
} );
}
} )();
} )();
}

setTemporaryURL();
}
Expand Down Expand Up @@ -604,7 +635,6 @@ function VideoEdit( {
<VideoSEOModal
isOpen={ isSEOModalOpen }
setIsOpen={ setIsSEOModelOpen }
attachmentData={ videoResponse }
attributes={ attributes }
setAttributes={ setAttributes }
/>
Expand Down
2 changes: 2 additions & 0 deletions assets/src/blocks/godam-player/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ function isObjectEmpty( obj ) {
* @return {string} An ISO 8601 duration string in the format 'PTnHnMnS'.
*/
function secondsToISO8601( seconds ) {
seconds = Math.floor( seconds ); // ensure whole seconds

const duration = {
hours: Math.floor( seconds / 3600 ),
minutes: Math.floor( ( seconds % 3600 ) / 60 ),
Expand Down
1 change: 1 addition & 0 deletions assets/src/css/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
$godam-primary-gradient: linear-gradient(83.85deg, #AB3A6C -9.3%, #E6533A 120.31%);
$godam-primary-color: rgba(194, 0, 0, 1);
$godam-light-color: rgba(255, 244, 244, 1);
$godam-primary-text-color: #AB3A6C;

$godam-gray-color: rgba(243, 245, 247, 1);
$godam-black-color: rgba(33, 33, 33, 1);
Expand Down
Loading