From 6e3e0315c5dca7a37f1d148fa03fc9da05a0633f Mon Sep 17 00:00:00 2001 From: Jack Reed <phillipjreed@gmail.com> Date: Fri, 8 Jan 2021 15:59:40 -0700 Subject: [PATCH] Use getDefaultLabel to get caption labels --- __tests__/src/components/AudioViewer.test.js | 4 ++-- __tests__/src/components/VideoViewer.test.js | 4 ++-- src/components/AudioViewer.js | 2 +- src/components/VideoViewer.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/__tests__/src/components/AudioViewer.test.js b/__tests__/src/components/AudioViewer.test.js index ecaf18ac5..cca67ee5d 100644 --- a/__tests__/src/components/AudioViewer.test.js +++ b/__tests__/src/components/AudioViewer.test.js @@ -40,8 +40,8 @@ describe('AudioViewer', () => { { getFormat: () => 'video/mp4', id: 1 }, ], captions: [ - { getLabel: () => 'English', getProperty: () => 'en', id: 1 }, - { getLabel: () => 'French', getProperty: () => 'fr', id: 2 }, + { getDefaultLabel: () => 'English', getProperty: () => 'en', id: 1 }, + { getDefaultLabel: () => 'French', getProperty: () => 'fr', id: 2 }, ], }, true); expect(wrapper.contains(<track src={1} label="English" srcLang="en" />)).toBe(true); diff --git a/__tests__/src/components/VideoViewer.test.js b/__tests__/src/components/VideoViewer.test.js index 99e229393..7b3521c08 100644 --- a/__tests__/src/components/VideoViewer.test.js +++ b/__tests__/src/components/VideoViewer.test.js @@ -37,8 +37,8 @@ describe('VideoViewer', () => { it('captions', () => { wrapper = createWrapper({ captions: [ - { getLabel: () => 'English', getProperty: () => 'en', id: 1 }, - { getLabel: () => 'French', getProperty: () => 'fr', id: 2 }, + { getDefaultLabel: () => 'English', getProperty: () => 'en', id: 1 }, + { getDefaultLabel: () => 'French', getProperty: () => 'fr', id: 2 }, ], videoResources: [ { getFormat: () => 'video/mp4', id: 1 }, diff --git a/src/components/AudioViewer.js b/src/components/AudioViewer.js index 5d80e059c..9c7523db5 100644 --- a/src/components/AudioViewer.js +++ b/src/components/AudioViewer.js @@ -20,7 +20,7 @@ export class AudioViewer extends Component { ))} {captions.map(caption => ( <Fragment key={caption.id}> - <track src={caption.id} label={caption.getLabel()} srcLang={caption.getProperty('language')} /> + <track src={caption.id} label={caption.getDefaultLabel()} srcLang={caption.getProperty('language')} /> </Fragment> ))} </audio> diff --git a/src/components/VideoViewer.js b/src/components/VideoViewer.js index be9e8ab46..2e6ab498e 100644 --- a/src/components/VideoViewer.js +++ b/src/components/VideoViewer.js @@ -19,7 +19,7 @@ export class VideoViewer extends Component { ))} {captions.map(caption => ( <Fragment key={caption.id}> - <track src={caption.id} label={caption.getLabel()} srcLang={caption.getProperty('language')} /> + <track src={caption.id} label={caption.getDefaultLabel()} srcLang={caption.getProperty('language')} /> </Fragment> ))} </video> -- GitLab