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
16 changes: 16 additions & 0 deletions admin/class-rtgodam-transcoder-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,22 @@ public function expired_api_key_notice() {
return;
}

// rtgodam_get_api_key_status() only reads the persistent DB status option
// ('rtgodam-api-key-status') which can NEVER contain 'verification_failed'
// because that state is transient and not persistable. The actual runtime
// status — including transient 'verification_failed' — is stored in the
// 'rtgodam_user_data' option by rtgodam_get_user_data(). Read from there
// so we don't show a false "expired" banner when the server is temporarily
// unreachable.
$cached_user_data = get_option( 'rtgodam_user_data', array() );
$runtime_status = isset( $cached_user_data['api_key_status'] )
? $cached_user_data['api_key_status']
: rtgodam_get_api_key_status();

if ( \RTGODAM\Inc\Enums\Api_Key_Status::VERIFICATION_FAILED === $runtime_status ) {
return;
}

$pricing_url = add_query_arg(
array(
'utm_campaign' => 'expired-key',
Expand Down
10 changes: 9 additions & 1 deletion pages/video-editor/VideoJSPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ const layerTypes = [
icon: thumbsUp,
type: 'poll',
},
// Merge add-on layer types registered via PHP filters (e.g. WooCommerce).
...( window.godamVideoEditorConfig?.layerOptions || [] ),
];

export const VideoJS = ( props ) => {
Expand Down Expand Up @@ -681,7 +683,13 @@ const Slider = ( props ) => {
>
<div className="layer-indicator--container">
<div className={ `icon ${ layer.id === currentLayerID ? 'active' : '' }` }>
<Icon icon={ layerTypes.find( ( type ) => type.type === layer.type )?.icon } />
{ ( () => {
const layerType = layerTypes.find( ( type ) => type.type === layer.type );
if ( layerType?.iconUrl ) {
return <img src={ layerType.iconUrl } alt={ layerType.title } className="layer-indicator__addon-icon" />;
}
return <Icon icon={ layerType?.icon } />;
} )() }
<div>
{ layer?.type?.toUpperCase() }
{
Expand Down
6 changes: 5 additions & 1 deletion pages/video-editor/components/SidebarLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,13 @@ const SidebarLayers = ( { currentTime, onSelectLayer, onPauseVideo, duration } )
addWarning = true;
}

// Disable the button when the required plugin/feature is inactive
// (e.g. form plugin not installed, or WooCommerce layer API key missing/expired).
const isLayerDisabled = ( formType && ! formType.isActive ) || layerData?.isActive === false;

return (
<Tooltip
key={ layer.id }
className="w-full flex justify-between items-center px-2 py-3 border rounded-md mb-2 hover:bg-gray-50 cursor-pointer"
text={ tooltipMessage }
placement="right"
>
Expand All @@ -304,6 +307,7 @@ const SidebarLayers = ( { currentTime, onSelectLayer, onPauseVideo, duration } )
dispatch( setCurrentLayer( layer ) );
onSelectLayer( layer.displayTime );
} }
disabled={ isLayerDisabled }
>
<div className="flex items-center gap-2">
{
Expand Down
10 changes: 10 additions & 0 deletions pages/video-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@
}
}

// Add-on layer icon (e.g. WooCommerce) rendered as <img>.
// Matches the intrinsic 24x24 size of the WordPress <Icon> SVG component.
.layer-indicator__addon-icon {
width: 20px;
height: 20px;
display: block;
flex-shrink: 0;
margin: 2px;
}

.info {
position: absolute;
bottom: -3rem;
Expand Down
Loading