dispatch load command before dispatch subtitles commands

This commit is contained in:
NikolaBorislavovHristov 2019-01-17 10:13:20 +02:00
parent f8230ce408
commit c4b40a8bf0

View file

@ -40,13 +40,13 @@ class Player extends Component {
}
componentDidMount() {
this.dispatch('command', 'load', this.props.stream, {});
this.dispatch('command', 'addSubtitleTracks', [{
url: 'https://raw.githubusercontent.com/caitp/ng-media/master/example/assets/captions/bunny-en.vtt',
origin: 'Github',
label: 'English'
}]);
this.dispatch('setProp', 'selectedSubtitleTrackId', 'https://raw.githubusercontent.com/caitp/ng-media/master/example/assets/captions/bunny-en.vtt');
this.dispatch('command', 'load', this.props.stream, {});
}
onEnded = () => {