adds audioOnly option that always displays poster image (if provided) on top of player
This commit is contained in:
		@@ -187,6 +187,7 @@ using System.Collections.Generic;
 | 
				
			|||||||
       }}                                      // Store reference
 | 
					       }}                                      // Store reference
 | 
				
			||||||
       rate={1.0}                              // 0 is paused, 1 is normal.
 | 
					       rate={1.0}                              // 0 is paused, 1 is normal.
 | 
				
			||||||
       volume={1.0}                            // 0 is muted, 1 is normal.
 | 
					       volume={1.0}                            // 0 is muted, 1 is normal.
 | 
				
			||||||
 | 
					       audioOnly={true|false}                  // Always displays poster image over player if provided. Default false
 | 
				
			||||||
       muted={true|false}                      // Mutes the audio entirely. Default false
 | 
					       muted={true|false}                      // Mutes the audio entirely. Default false
 | 
				
			||||||
       paused={true|false}                     // Pauses playback entirely. Default false
 | 
					       paused={true|false}                     // Pauses playback entirely. Default false
 | 
				
			||||||
       resizeMode="cover"                      // Fill the whole screen at aspect ratio.*
 | 
					       resizeMode="cover"                      // Fill the whole screen at aspect ratio.*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										4
									
								
								Video.js
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								Video.js
									
									
									
									
									
								
							@@ -65,7 +65,7 @@ export default class Video extends Component {
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _onSeek = (event) => {
 | 
					  _onSeek = (event) => {
 | 
				
			||||||
    if (this.state.showPoster) {
 | 
					    if (this.state.showPoster && !this.props.audioOnly) {
 | 
				
			||||||
      this.setState({showPoster: false});
 | 
					      this.setState({showPoster: false});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -129,7 +129,7 @@ export default class Video extends Component {
 | 
				
			|||||||
  };
 | 
					  };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  _onPlaybackRateChange = (event) => {
 | 
					  _onPlaybackRateChange = (event) => {
 | 
				
			||||||
    if (this.state.showPoster && (event.nativeEvent.playbackRate !== 0)) {
 | 
					    if (this.state.showPoster && (event.nativeEvent.playbackRate !== 0) && (!this.props.audioOnly)) {
 | 
				
			||||||
      this.setState({showPoster: false});
 | 
					      this.setState({showPoster: false});
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user