Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit f7e2d70

Browse files
committed
Tweak video component code style
1 parent e05fcc8 commit f7e2d70

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/components/views/messages/MVideoBody.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
7171
}
7272
}
7373

74-
_getContentUrl(): string|null {
74+
private getContentUrl(): string|null {
7575
const content = this.props.mxEvent.getContent();
7676
if (content.file !== undefined) {
7777
return this.state.decryptedUrl;
@@ -80,7 +80,7 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
8080
}
8181
}
8282

83-
_getThumbUrl(): string|null {
83+
private getThumbUrl(): string|null {
8484
const content = this.props.mxEvent.getContent();
8585
if (content.file !== undefined) {
8686
return this.state.decryptedThumbnailUrl;
@@ -142,8 +142,8 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
142142
}
143143
}
144144

145-
async _videoOnPlay() {
146-
if (this._getContentUrl() || this.state.fetchingData || this.state.error) {
145+
private videoOnPlay = async () => {
146+
if (this.getContentUrl() || this.state.fetchingData || this.state.error) {
147147
// We have the file, we are fetching the file, or there is an error.
148148
return;
149149
}
@@ -195,8 +195,8 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
195195
);
196196
}
197197

198-
const contentUrl = this._getContentUrl();
199-
const thumbUrl = this._getThumbUrl();
198+
const contentUrl = this.getContentUrl();
199+
const thumbUrl = this.getThumbUrl();
200200
let height = null;
201201
let width = null;
202202
let poster = null;
@@ -217,7 +217,7 @@ export default class MVideoBody extends React.PureComponent<IProps, IState> {
217217
<span className="mx_MVideoBody">
218218
<video className="mx_MVideoBody" src={contentUrl} title={content.body}
219219
controls preload={preload} muted={autoplay} autoPlay={autoplay}
220-
height={height} width={width} poster={poster} onPlay={this._videoOnPlay.bind(this)}>
220+
height={height} width={width} poster={poster} onPlay={this.videoOnPlay}>
221221
</video>
222222
<MFileBody {...this.props} decryptedBlob={this.state.decryptedBlob} />
223223
</span>

0 commit comments

Comments
 (0)