react-insta-stories icon indicating copy to clipboard operation
react-insta-stories copied to clipboard

Implemented possibility to mute/unmute the videos

Open koo27 opened this issue 6 years ago • 2 comments

I needed to start the videos without sound, but needed to handle that by user hand. So I implemented the possibility to add the property muted to the story object as a boolean value. If true, the video will start muted, otherwise you'll be able to hear the sound. Please remember that you must specify the type="video" property in the story.

I also added two new props to the Stories object: mutedComponent and unmutedComponent in order to customize the button/text to mute/unmute the videos.

An easy example could be

mutedComponent={<h2 style={{ color: "white", fontSize: 22}}>UNMUTE</h2>}
unmutedComponent={<h2 style={{ color: "white", fontSize: 22}}>MUTE</h2>}

Of course you could use an Icon or whatever you prefer.

I tried to follow your code style, and hope everything is fine. My side it seems to work great.

koo27 avatar Dec 13 '19 15:12 koo27

can you give an example of how to use muted or how to trigger mute

imdewan avatar Aug 18 '23 22:08 imdewan