0.2.3 • Published 7 years ago

react-popcorn v0.2.3

Weekly downloads
56
License
-
Repository
github
Last release
7 years ago

React Components and utilities to Embbed or Create Interactive Components play with Youtube Player

Popcorn Component

Popcorn Component get information from player and transfer it to other child. If you want to write another component. Just put it in Popcorn it will receive following props

  duration
  loadedSeconds
  playedSeconds
  played // playing or not
  player // with seekTo method

So you are free to write interactive component.

Examples

You can look example in App.js that demo how ReactPopcorn's components works.

Run

Yarn start

Import

import Popcorn, { Player, Subtitle, getYoutubeCaption } from './popcorn/src';

Render method

<Popcorn videoId={videoId} ref={node => this.player = node && node.player}>
  <div onMouseOver={this.handleMouseOver} onMouseLeave={this.handleMouseLeave}>
    <Player 
      controls
      youtubeConfig={youtubeConfig}
    />
  </div>
  <div style={{ position: 'absolute', top: 10, width: '100%' }}>
    <Subtitle 
      data={getYoutubeCaption(videoId, { langCode: 'ko', name: '' })} 
    />
  </div>
  <div style={{ position: 'absolute', bottom: hovering ? 50 : 10, width: '100%', transition: 'bottom 0.3s' }}>
    <Subtitle 
      data={getYoutubeCaption(videoId, { langCode: 'en', name: 'CC' })} 
    />
  </div>
</Popcorn>

Build

webpack

This project was bootstrapped with Create React App.

0.2.3

7 years ago

0.2.2

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago