@@ -29,6 +29,7 @@ import ConnectMixin from '../../globals/mixins/connect';
2929import StableSelectorMixin from '../../globals/mixins/stable-selector' ;
3030import C4DVideoPlayerComposite from './video-player-composite' ;
3131import { carbonElement as customElement } from '@carbon/web-components/es/globals/decorators/carbon-element.js' ;
32+ import { LocaleAPI } from '@carbon/ibmdotcom-services/es/services/Locale/index' ;
3233
3334const { stablePrefix : c4dPrefix } = settings ;
3435
@@ -115,9 +116,18 @@ export const C4DVideoPlayerContainerMixin = <
115116 // Not using TypeScript `private` due to: microsoft/TypeScript#17744
116117 _requestsEmbedVideo : { [ videoId : string ] : Promise < any > } = { } ;
117118
119+ /**
120+ * Custom video name
121+ */
118122 @property ( { type : String , attribute : 'customvideoname' } )
119123 customVideoName = '' ;
120124
125+ /**
126+ * Language code
127+ */
128+ @property ( )
129+ lc = '' ;
130+
121131 /**
122132 * Sets the state that the API call for embedding the video for the given video ID is in progress.
123133 *
@@ -193,7 +203,14 @@ export const C4DVideoPlayerContainerMixin = <
193203 * <c4d-video-player-container customVideoName="overwritten media title here">...
194204 *
195205 */
196- const mediaTitle = this ?. [ 'customVideoName' ] || this ?. [ 'caption' ] ;
206+
207+ let mediaTitle : string ;
208+
209+ if ( this . lc . toLowerCase ( ) === 'en' ) {
210+ mediaTitle = this ?. [ 'customVideoName' ] || this ?. [ 'caption' ] ;
211+ } else {
212+ mediaTitle = ' ' ;
213+ }
197214
198215 let playerOptions = { } ;
199216 const autoplayPreference = this . _getAutoplayPreference ( ) ;
@@ -324,7 +341,7 @@ export const C4DVideoPlayerContainerMixin = <
324341 /**
325342 * Calls the data-* attribute transpose function to target `c4d-video-player`'s button element.
326343 */
327- firstUpdated ( ) {
344+ async firstUpdated ( ) {
328345 window . requestAnimationFrame ( ( ) => {
329346 const button =
330347 this . querySelector ( 'c4d-video-player' ) ?. shadowRoot ?. querySelector (
@@ -338,6 +355,10 @@ export const C4DVideoPlayerContainerMixin = <
338355 }
339356 this . transposeAttributes ( button , [ 'href' ] ) ;
340357 } ) ;
358+
359+ //get LC
360+ const { lc } = await LocaleAPI . getLocale ( ) ;
361+ this . lc = lc ;
341362 }
342363
343364 prefersAutoplayStorageKey = `${ c4dPrefix } -background-video-prefers-autoplay` ;
0 commit comments