Skip to content

Commit

Permalink
Merge pull request #13 from prototyp3-dev/feature/rives-video
Browse files Browse the repository at this point in the history
feat: youtube RiVES video
  • Loading branch information
arthuravianna authored Jan 23, 2024
2 parents 5cb9ec8 + 09c2a00 commit 4ffc06b
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 2 deletions.
23 changes: 23 additions & 0 deletions frontend/app/components/youtubeVideo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"use client"


import React from 'react';
import YouTube, { YouTubeProps } from 'react-youtube';

function YoutubeVideo({videoId}:{videoId:string}) {
const onPlayerReady: YouTubeProps['onReady'] = (event) => {
// access to player in all event handlers via event.target
event.target.pauseVideo();
}

const opts: YouTubeProps['opts'] = {
playerVars: {
// https://developers.google.com/youtube/player_parameters
autoplay: 1,
},
};

return <YouTube videoId={videoId} opts={opts} onReady={onPlayerReady} />;
}

export default YoutubeVideo;
5 changes: 3 additions & 2 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Title from "./components/Title";
import YoutubeVideo from "./components/youtubeVideo";
import { fontPressStart2P } from './utils/font';


Expand All @@ -15,8 +16,8 @@ export default function Home() {
RIVES will enable decentralized trustless tournaments so that no one can deny your bounty after an epic play!
</p>

<div className="w-1/2 bg-black h-1/2 rounded flex items-center justify-center">
Demo Video
<div className="w-1/2 flex items-center justify-center">
<YoutubeVideo videoId="1x5B1xJY7as" />
</div>

</section>
Expand Down
50 changes: 50 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"react": "^18",
"react-dom": "^18",
"react-use-downloader": "^1.2.4",
"react-youtube": "^10.1.0",
"three": "^0.159.0"
},
"devDependencies": {
Expand Down

0 comments on commit 4ffc06b

Please sign in to comment.