Merge pull request #20153 from prlanzarin/u27/fix/Arthurk12-live-crashes-1800
fix(bbb-html5): potential crash in Youtube captions toggle
This commit is contained in:
commit
15e857abe5
@ -252,10 +252,14 @@ class VideoPlayer extends Component {
|
||||
}, () => {
|
||||
const { subtitlesOn } = this.state;
|
||||
const { isPresenter } = this.props;
|
||||
const internalPlayer = this?.player?.getInternalPlayer();
|
||||
if (!internalPlayer) return;
|
||||
if (!isPresenter && subtitlesOn) {
|
||||
this?.player?.getInternalPlayer()?.setOption('captions', 'reload', true);
|
||||
} else {
|
||||
this?.player?.getInternalPlayer()?.unloadModule('captions');
|
||||
if (typeof internalPlayer.setOption === 'function') {
|
||||
internalPlayer.setOption('captions', 'reload', true);
|
||||
}
|
||||
} else if (typeof internalPlayer.unloadModule === 'function') {
|
||||
internalPlayer.unloadModule('captions');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user