Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

youtbe trailer npm

$ npm install react-youtube

//usage
<YouTube
  videoId={string}                  // defaults -> null
  id={string}                       // defaults -> null
  className={string}                // defaults -> null
  containerClassName={string}       // defaults -> ''
  opts={obj}                        // defaults -> {}
  onReady={func}                    // defaults -> noop
  onPlay={func}                     // defaults -> noop
  onPause={func}                    // defaults -> noop
  onEnd={func}                      // defaults -> noop
  onError={func}                    // defaults -> noop
  onStateChange={func}              // defaults -> noop
  onPlaybackRateChange={func}       // defaults -> noop
  onPlaybackQualityChange={func}    // defaults -> noop
/>

//example
import React from 'react';
import YouTube from 'react-youtube';
 
class Example extends React.Component {
  render() {
    const opts = {
      height: '390',
      width: '640',
      playerVars: {
        // https://developers.google.com/youtube/player_parameters
        autoplay: 1,
      },
    };
 
    return <YouTube videoId="2g811Eo7K8U" opts={opts} onReady={this._onReady} />;
  }
 
  _onReady(event) {
    // access to player in all event handlers via event.target
    event.target.pauseVideo();
  }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: es6 for-of loop 
Javascript :: add edit delete from table using jquery 
Javascript :: how to pronounce psychological 
Javascript :: latvia 
Javascript :: n JavaScript, select your <h1 element and give it some text 
Javascript :: buscar valor maximo y mínimo array jquery 
Javascript :: js database field naming conventions 
Javascript :: remove etag express 
Javascript :: rrule exdate example 
Javascript :: jquery how to detect click outside off-canvas-navigation 
Javascript :: prefix increment 
Javascript :: how to trim dates in react 
Javascript :: delete object property vs undefined assignment javascript 
Javascript :: react buttons npm 
Javascript :: node js if 
Javascript :: : not foundram Files/nodejs/npm: 3: : not foundram Files/nodejs/npm: 5: 
Javascript :: resellerclub api with react js 
Javascript :: retrieve list by id from firebase angular 
Javascript :: javascript on the fly form submit 
Javascript :: JavaScript Operator Precedence Values 
Javascript :: react deployment pipeline 
Javascript :: matriz bucle js 
Javascript :: chanhe button yext jquery 
Javascript :: jlkjl 
Javascript :: simple callback pattern 
Javascript :: immediate invoke jquery arrow function 
Javascript :: sinon chaining method 
Javascript :: bad request while authenticating locally with passport-local-mongoose stackoverflow 
Javascript :: express orm 
Javascript :: 7.7. Unicode Table 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =