Skip to content

Commit

Permalink
fix: 对修复之前ie问题添加ie判断
Browse files Browse the repository at this point in the history
  • Loading branch information
Lisuhan committed Apr 25, 2021
1 parent b14a0a8 commit b6af89a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/griffith/src/components/Player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {MinimalTimeline} from '../Timeline'
import getBufferedTime from '../../utils/getBufferedTime'
import storage from '../../utils/storage'
import Pip from '../../utils/pip'
import isIE from '../../utils/isIE'
import {ObjectFitContext} from '../../contexts/ObjectFit'

import styles, {hiddenOrShownStyle} from './styles'
Expand Down Expand Up @@ -179,7 +180,7 @@ class Player extends Component {
this.setState({isLoading: true})
}
// workaround a bug in IE about replaying a video.
if (this.state.currentTime !== 0) {
if (isIE && this.state.currentTime !== 0) {
this.handleSeek(0)
}
} else {
Expand Down
5 changes: 5 additions & 0 deletions packages/griffith/src/utils/isIE.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const isIE =
navigator.userAgent.indexOf('compatible') > -1 &&
navigator.userAgent.indexOf('MSIE') > -1

export default isIE

0 comments on commit b6af89a

Please sign in to comment.