mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 19:56:47 +03:00
Merge pull request #6615 from SimonBrandner/fix/media-error
Properly handle media errors
This commit is contained in:
commit
946ae73e1d
2 changed files with 4 additions and 4 deletions
|
@ -72,7 +72,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private playMedia() {
|
private async playMedia() {
|
||||||
const element = this.element.current;
|
const element = this.element.current;
|
||||||
if (!element) return;
|
if (!element) return;
|
||||||
this.onAudioOutputChanged(MediaDeviceHandler.getAudioOutput());
|
this.onAudioOutputChanged(MediaDeviceHandler.getAudioOutput());
|
||||||
|
@ -90,7 +90,7 @@ export default class AudioFeed extends React.Component<IProps, IState> {
|
||||||
// should serialise the ones that need to be serialised but then be able to interrupt
|
// should serialise the ones that need to be serialised but then be able to interrupt
|
||||||
// them with another load() which will cancel the pending one, but since we don't call
|
// them with another load() which will cancel the pending one, but since we don't call
|
||||||
// load() explicitly, it shouldn't be a problem. - Dave
|
// load() explicitly, it shouldn't be a problem. - Dave
|
||||||
element.play();
|
await element.load();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.info("Failed to play media element with feed", this.props.feed, e);
|
logger.info("Failed to play media element with feed", this.props.feed, e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,7 +112,7 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private playMedia() {
|
private async playMedia() {
|
||||||
const element = this.element;
|
const element = this.element;
|
||||||
if (!element) return;
|
if (!element) return;
|
||||||
// We play audio in AudioFeed, not here
|
// We play audio in AudioFeed, not here
|
||||||
|
@ -129,7 +129,7 @@ export default class VideoFeed extends React.PureComponent<IProps, IState> {
|
||||||
// should serialise the ones that need to be serialised but then be able to interrupt
|
// should serialise the ones that need to be serialised but then be able to interrupt
|
||||||
// them with another load() which will cancel the pending one, but since we don't call
|
// them with another load() which will cancel the pending one, but since we don't call
|
||||||
// load() explicitly, it shouldn't be a problem. - Dave
|
// load() explicitly, it shouldn't be a problem. - Dave
|
||||||
element.play();
|
await element.play();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.info("Failed to play media element with feed", this.props.feed, e);
|
logger.info("Failed to play media element with feed", this.props.feed, e);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue