Skip to content

Commit

Permalink
feat: add loop prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ambar committed Aug 11, 2021
1 parent f59531d commit 20bf9e8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/griffith/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ interface PlaySource {
interface PlayerContainerProps {
id: string
standalone?: boolean
autoplay?: boolean
loop?: boolean
title?: string
cover: string
duration: number
Expand Down
3 changes: 3 additions & 0 deletions packages/griffith/src/components/Player/Player.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class Player extends Component {
onEvent: PropTypes.func.isRequired,
onBeforePlay: PropTypes.func.isRequired,
autoplay: PropTypes.bool,
loop: PropTypes.bool,
muted: PropTypes.bool,
disablePictureInPicture: PropTypes.bool,
hiddenPlayButton: PropTypes.bool,
Expand Down Expand Up @@ -436,6 +437,7 @@ class Player extends Component {
title,
cover,
standalone,
loop,
onEvent,
useMSE,
useAutoQuality,
Expand Down Expand Up @@ -486,6 +488,7 @@ class Player extends Component {
controls={isMobile && isPlaybackStarted}
paused={!isPlaying}
volume={volume}
loop={loop}
onPlay={this.handleVideoPlay}
onPause={this.handleVideoPause}
onEnded={this.handleVideoEnded}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const PlayerContainer = ({
useMSE,
locale = 'en',
autoplay,
loop,
muted,
disablePictureInPicture,
hiddenPlayButton,
Expand Down Expand Up @@ -63,6 +64,7 @@ const PlayerContainer = ({
useMSE={useMSE}
useAutoQuality={useAutoQuality}
autoplay={autoplay}
loop={loop}
muted={muted}
disablePictureInPicture={disablePictureInPicture}
hiddenPlayButton={hiddenPlayButton}
Expand Down Expand Up @@ -95,6 +97,8 @@ const PlayerContainer = ({

PlayerContainer.propTypes = {
standalone: PropTypes.bool,
autoplay: PropTypes.bool,
loop: PropTypes.bool,
id: PropTypes.string.isRequired,
title: PropTypes.string,
cover: PropTypes.string,
Expand Down
3 changes: 3 additions & 0 deletions packages/griffith/src/components/Video/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const isNotAllowedError = error => error && error.name === 'NotAllowedError'
class Video extends Component {
static propTypes = {
controls: PropTypes.bool,
loop: PropTypes.bool,
paused: PropTypes.bool,
volume: PropTypes.number,
onPlay: PropTypes.func,
Expand Down Expand Up @@ -273,6 +274,7 @@ class Video extends Component {
const {
src,
controls,
loop,
paused,
volume,
onPlay,
Expand Down Expand Up @@ -301,6 +303,7 @@ class Video extends Component {
x-webkit-airplay="deny"
muted={!volume}
controls={controls}
loop={loop}
src={src}
onPlay={onPlay}
onPause={onPause}
Expand Down

0 comments on commit 20bf9e8

Please sign in to comment.