TheWidlarzGroup / react-native-video

A <Video /> component for react-native
http://thewidlarzgroup.github.io/react-native-video/
MIT License
7.11k stars 2.88k forks source link

Add custom styling to the video controls #2820

Open Alexandria opened 2 years ago

Alexandria commented 2 years ago

Feature Request

Why it is needed

Would love to be able to change the styling of the controls to better match the theme or branding of an app.

17-05-m0mgj-hprvd

For example I would want to lower the opacity of the controls so that just the speaker icon is visible. Or change the color of the play bar etc.

Possible implementation

Just at a quick glance of the code I saw styles for seekbarFill and seekbarHandle in the VideoPlayer.andriod.tsx file. Would it be possible to have the option to override the default styles here? (as well as with ios )

Code sample

Ideally it could look something like this when implmented

// Load the module
import Video from 'react-native-video';
<Video source={{uri: "background"}}   
       ref={(ref) => {
         this.player = ref
       }}                                      
       onBuffer={this.onBuffer}              
       onError={this.videoError}               
       style={styles.backgroundVideo} />
       controls
       styleControls={
              seekbarTrackColor: "green",   // This would override seekbarTrack.backgroundColor: '#333',
              seekbarTrackWidth: "100%"    // This would override seekbarTrack.Width
              seekbarHandleColor: "black"  // This would override seekbarHandle.backgroundColor: '#333',
              topControls:"row"  // This could also be column left aligned or column right aligned. 
       }
/>
// Later on in your styles..
var styles = StyleSheet.create({
  backgroundVideo: {
   ......
  },
});
Alexandria commented 2 years ago

Im happy to submit a PR and work on this.

freeboub commented 2 years ago

I would be happy to merge it ! :) Thank you !

nikitph commented 1 year ago

@Alexandria is this something in progress on your end? Would love to see this

codefromahmad commented 1 year ago

@Alexandria I am also waiting for it.

mitchiemt11 commented 1 year ago

@Alexandria was this merged?

mitchiemt11 commented 1 year ago

@codefromahmad did you get this to work? I'm also still waiting for this.

AhmedMustafa505 commented 10 months ago

Is this working now ???

TriptiPant01 commented 3 months ago

Any Progress on this?

aman-technyx commented 1 month ago

still looking this feature !!