docusaurus/website/pages/youtube.js
Endilie Yacop Sucipto 1f91d19a8c
chore: move to monorepo (#1297)
* chore: move to monorepo

* lint all js file

* simplify circleCI

* fix failing tests

* fix tests due to folder rename

* fix test since v1 website is renamed
2019-03-23 14:21:36 +07:00

39 lines
903 B
JavaScript

/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable */
import React from 'react';
import Head from '@docusaurus/Head';
import YouTube from 'react-youtube';
export default class Player extends React.Component {
render() {
const opts = {
height: '390',
width: '640',
playerVars: {
autoplay: 1,
},
};
return (
<div>
<Head>
<title>My Youtube</title>
</Head>
<div align="center">
{/* this is a React-youtube component */}
<YouTube videoId="d9IxdwEFk1c" opts={opts} onReady={this._onReady} />
</div>
</div>
);
}
_onReady(event) {
// access to player in all event handlers via event.target
event.target.playVideo();
}
}