Skip to content

Commit

Permalink
fix(FEC-7100): remove playback rate option in live playback (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvir Hazout authored and Dan Ziv committed Sep 11, 2017
1 parent e2a3c8f commit 163696d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/components/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const defaultSpeeds = [0.5, 1, 2, 4];
*/
const mapStateToProps = state => ({
videoTracks: state.engine.videoTracks,
isMobile: state.shell.isMobile
isMobile: state.shell.isMobile,
isLive: state.engine.isLive
});

@connect(mapStateToProps, bindActions(actions))
Expand Down Expand Up @@ -159,7 +160,7 @@ class SettingsControl extends BaseComponent {
* @returns {React$Element} - component element
* @memberof SettingsControl
*/
render(props: any) {
render(props: any): React$Element<any> | void {
let speedOptions = defaultSpeeds
.reduce((acc, speed) => {
let speedOption = {
Expand Down Expand Up @@ -196,6 +197,8 @@ class SettingsControl extends BaseComponent {
});
}

if (props.isLive && qualityOptions.length === 0) return undefined;

return (
<div
ref={c => this._controlSettingsElement=c}
Expand All @@ -218,9 +221,12 @@ class SettingsControl extends BaseComponent {
<SmartContainerItem icon='quality' label={<Text id='settings.quality' />} options={qualityOptions} onSelect={(o) => this.onQualityChange(o)} />
</Localizer>
}
<Localizer>
<SmartContainerItem icon='speed' label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />
</Localizer>
{
props.isLive ? '' :
<Localizer>
<SmartContainerItem icon='speed' label={<Text id='settings.speed' />} options={speedOptions} onSelect={(o) => this.onSpeedChange(o)} />
</Localizer>
}
</SmartContainer>
}
</div>
Expand Down

0 comments on commit 163696d

Please sign in to comment.