Skip to content
Snippets Groups Projects
Commit 6e3e0315 authored by Jack Reed's avatar Jack Reed
Browse files

Use getDefaultLabel to get caption labels

parent a9c747d4
Branches fix-av
Tags
No related merge requests found
...@@ -40,8 +40,8 @@ describe('AudioViewer', () => { ...@@ -40,8 +40,8 @@ describe('AudioViewer', () => {
{ getFormat: () => 'video/mp4', id: 1 }, { getFormat: () => 'video/mp4', id: 1 },
], ],
captions: [ captions: [
{ getLabel: () => 'English', getProperty: () => 'en', id: 1 }, { getDefaultLabel: () => 'English', getProperty: () => 'en', id: 1 },
{ getLabel: () => 'French', getProperty: () => 'fr', id: 2 }, { getDefaultLabel: () => 'French', getProperty: () => 'fr', id: 2 },
], ],
}, true); }, true);
expect(wrapper.contains(<track src={1} label="English" srcLang="en" />)).toBe(true); expect(wrapper.contains(<track src={1} label="English" srcLang="en" />)).toBe(true);
......
...@@ -37,8 +37,8 @@ describe('VideoViewer', () => { ...@@ -37,8 +37,8 @@ describe('VideoViewer', () => {
it('captions', () => { it('captions', () => {
wrapper = createWrapper({ wrapper = createWrapper({
captions: [ captions: [
{ getLabel: () => 'English', getProperty: () => 'en', id: 1 }, { getDefaultLabel: () => 'English', getProperty: () => 'en', id: 1 },
{ getLabel: () => 'French', getProperty: () => 'fr', id: 2 }, { getDefaultLabel: () => 'French', getProperty: () => 'fr', id: 2 },
], ],
videoResources: [ videoResources: [
{ getFormat: () => 'video/mp4', id: 1 }, { getFormat: () => 'video/mp4', id: 1 },
......
...@@ -20,7 +20,7 @@ export class AudioViewer extends Component { ...@@ -20,7 +20,7 @@ export class AudioViewer extends Component {
))} ))}
{captions.map(caption => ( {captions.map(caption => (
<Fragment key={caption.id}> <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> </Fragment>
))} ))}
</audio> </audio>
......
...@@ -19,7 +19,7 @@ export class VideoViewer extends Component { ...@@ -19,7 +19,7 @@ export class VideoViewer extends Component {
))} ))}
{captions.map(caption => ( {captions.map(caption => (
<Fragment key={caption.id}> <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> </Fragment>
))} ))}
</video> </video>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment