Youtube Player

Youtube Player#


This is an experimental feature.

This component inserts the Youtube iframe player into your react application


To use the react Youtube player component you have to import it from the reactjs-media module as YoutubePlayer


import React from "react";
import { YoutubePlayer } from "reactjs-media";
const MyVideo = () => {
return (
//you can pass in other props


List of the available props:

Note: Since this is an experimental feature we recommend right clicking on the video inorder to get the video url instead of copying from the browser address bar. Both work but there are some issuses incase of page reloads.

srcstring: RequiredThis represents the url of the video
titlestring: OptionalThis is needed to prevent iframe warning in the terminal
allowFullScreenBoolean: OptionalThis will enable the fullsscreen button on the player
classNamestring: OptionalThe can be placed incase you want to use it
heightstring or number: OptionalThe max height of the player
widthstring or number: OptionalThe max width of the player

Youtube player is only available in version 1.2.0 above if you want to use it then upgrade.


In version 1.3.x we plan to improve the youtube player component and add a soundcloud and other players. If you are willing you can contribute to the projects on Github