react-icons/fa#FaForward JavaScript Examples

The following examples show how to use react-icons/fa#FaForward. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: components.jsx    From reactjs-media with MIT License 5 votes vote down vote up
LowerControls = (props) => {
  const { Playing, CurrentTime, Duration, section } = useContext(VideoContext)
  const [fullscreen, setfullscreen] = useState(false)

  const { video } = props
  function play(e) {
    video.current.play()
    if (props.onPlay) {
      props.onPlay(e)
    }
  }
  function forward(e) {
    let dur = (5 / 100) * video.current.duration

    video.current.currentTime += dur
  }
  function pause(e) {
    video.current.pause()
  }
  const enterFullScreen = (e) => {
    section.current.requestFullscreen()
    if (props.onEnterFullScreen) {
      props.onEnterFullScreen(e)
    }
    setfullscreen(true)

  }
  const exitFullScreen = (e) => {
    section.current.ownerDocument.exitFullscreen()
    setfullscreen(false)

  }
  return (
    <>
      <div className="controls">
        <div className="play">
          {Playing ? <FaPause onClick={pause} /> :
            <FaPlay onClick={play} />}
        </div>
        <div className="foward">
          <FaForward onClick={forward} />
        </div>
        <div className="timestamps">
          {CurrentTime} / {Duration}
        </div>
        <div className="settimgs">
          <div className="fullscreen">
            {fullscreen === false ? <RiFullscreenFill onClick={enterFullScreen} /> :
              <MdFullscreenExit onClick={exitFullScreen} />}
          </div>
          {props.nosettings ? <></> :
            <Settings {...props} />}
        </div>
      </div>
    </>
  )
}