Skip to content

Commit

Permalink
feat: controlslist and disable pip props (#132)
Browse files Browse the repository at this point in the history
* fix: error when unmounted while setting up

* fix: add unmount check to handleError

* feat: add ability to configure controlslist and disable pip

Co-authored-by: = <=>
  • Loading branch information
suchk authored and fbaiodias committed Aug 10, 2021
1 parent 7c709a1 commit c743581
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video-recorder.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ export default class VideoRecorder extends Component {
chunkSize: PropTypes.number,
dataAvailableTimeout: PropTypes.number,
useVideoInput: PropTypes.bool,
/** Use this to configure the replaying video element's controlslist attribute */
videoControlsList: PropTypes.string,
/** Use this to disable picture in picture mode on the replaying video element */
disablePictureInPicture: PropTypes.bool,

renderDisconnectedView: PropTypes.func,
renderLoadingView: PropTypes.func,
Expand Down Expand Up @@ -718,6 +722,8 @@ export default class VideoRecorder extends Component {
const {
cameraViewClassName,
showReplayControls,
videoControlsList,
disablePictureInPicture,
replayVideoAutoplayAndLoopOff,
renderDisconnectedView,
renderVideoInputView,
Expand Down Expand Up @@ -770,6 +776,8 @@ export default class VideoRecorder extends Component {
controls={showReplayControls}
onClick={this.handleReplayVideoClick}
onDurationChange={this.handleDurationChange}
controlsList={videoControlsList}
disablePictureInPicture={disablePictureInPicture}
/>
{videoInput}
</CameraView>
Expand Down
13 changes: 13 additions & 0 deletions src/video-recorder.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,16 @@ stories.add(
stories.add('with isFlipped=false', () => (
<VideoRecorder isFlipped={false} showReplayControls {...actionLoggers} />
))

stories.add(
'with showReplayControls=true videoControlsList="nodownload" disablepictureinpicture',
() => (
<VideoRecorder
isOnInitially
showReplayControls
videoControlsList='nodownload'
disablePictureInPicture
{...actionLoggers}
/>
)
)

1 comment on commit c743581

@vercel
Copy link

@vercel vercel bot commented on c743581 Aug 10, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.