Unverified Commit e4e3ce18 authored by Hampton Maxwell's avatar Hampton Maxwell Committed by GitHub
Browse files

Merge pull request #1039 from shlokamin/master

adds audioOnly option that always displays poster image (if provided)…
parents a6808eea 06fafc88
Loading
Loading
Loading
Loading
+10 −0
Changes for README.md: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -218,6 +218,7 @@ var styles = StyleSheet.create({

### Configurable props
* [allowsExternalPlayback](#allowsexternalplayback)
* [audioOnly](#audioonly)
* [ignoreSilentSwitch](#ignoresilentswitch)
* [muted](#muted)
* [paused](#paused)
@@ -246,6 +247,15 @@ Indicates whether the player allows switching to external playback mode such as

Platforms: iOS

#### audioOnly
Indicates whether the player should only play the audio track and instead of displaying the video track, show the poster instead.
* **false (default)** - Display the video as normal
* **true** - Show the poster and play the audio

For this to work, the poster prop must be set.

Platforms: all

#### ignoreSilentSwitch
Controls the iOS silent switch behavior
* **"inherit" (default)** - Use the default AVPlayer behavior
+3 −2
Changes for Video.js: 3 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@ export default class Video extends Component {
  };

  _onSeek = (event) => {
    if (this.state.showPoster) {
    if (this.state.showPoster && !this.props.audioOnly) {
      this.setState({showPoster: false});
    }

@@ -132,7 +132,7 @@ export default class Video extends Component {
  };

  _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});
    }

@@ -307,6 +307,7 @@ Video.propTypes = {
  ignoreSilentSwitch: PropTypes.oneOf(['ignore', 'obey']),
  disableFocus: PropTypes.bool,
  controls: PropTypes.bool,
  audioOnly: PropTypes.bool,
  currentTime: PropTypes.number,
  progressUpdateInterval: PropTypes.number,
  useTextureView: PropTypes.bool,