Skip to content

Commit fa3a8fd

Browse files
authored
fix: mobile muted (#128)
1 parent 812fefb commit fa3a8fd

File tree

2 files changed

+1
-11
lines changed

2 files changed

+1
-11
lines changed

packages/griffith/src/components/Player/Player.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,6 @@ class Player extends Component {
402402
onPlaying={this.handleVideoPlaying}
403403
onSeeking={this.handleVideoSeeking}
404404
onSeeked={this.handleVideoSeeked}
405-
onVolumeChange={this.handleVideoVolumeChange}
406405
onProgress={this.handleVideoProgress}
407406
onEvent={onEvent}
408407
useMSE={useMSE}

packages/griffith/src/components/Video/Video.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ class Video extends Component {
3232
onPlaying: PropTypes.func,
3333
onSeeking: PropTypes.func,
3434
onSeeked: PropTypes.func,
35-
onVolumeChange: PropTypes.func,
3635
onProgress: PropTypes.func,
3736
onError: PropTypes.func.isRequired,
3837
onEvent: PropTypes.func.isRequired,
@@ -92,7 +91,7 @@ class Video extends Component {
9291
}
9392
}
9493

95-
if (this.root.volume !== volume ** 2) {
94+
if (this.root.volume !== volume ** 2 && !isMobile) {
9695
this.root.volume = volume ** 2
9796
}
9897
}
@@ -234,13 +233,6 @@ class Video extends Component {
234233
}
235234
}
236235

237-
handleVolumeChange = () => {
238-
const {onVolumeChange} = this.props
239-
if (onVolumeChange) {
240-
onVolumeChange(this.root.muted ? 0 : Math.sqrt(this.root.volume))
241-
}
242-
}
243-
244236
handleProgress = () => {
245237
const {onProgress} = this.props
246238
const buffered = this.root.buffered
@@ -321,7 +313,6 @@ class Video extends Component {
321313
onError={this.handleError}
322314
onDurationChange={this.handleDurationChange}
323315
onTimeUpdate={this.handleTimeUpdate}
324-
onVolumeChange={this.handleVolumeChange}
325316
onProgress={this.handleProgress}
326317
onWaiting={this.handleWaiting}
327318
onPlaying={this.handlePlaying}

0 commit comments

Comments
 (0)