Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
199 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,65 @@ | ||
import { useState } from "react"; | ||
import ReactPlayer from "react-player"; | ||
import Footer from "./Footer"; | ||
import ArrowForwardIosIcon from "@mui/icons-material/ArrowForwardIos"; | ||
import ArrowBackIosIcon from "@mui/icons-material/ArrowBackIos"; | ||
|
||
const ArrayBBogumi = [ | ||
"https://www.youtube.com/watch?v=Fn83vM8f1h8", | ||
"https://www.youtube.com/watch?v=ean9qb2Xtpc&t=120s", | ||
"https://www.youtube.com/watch?v=NeKdhpmVI64", | ||
"https://www.youtube.com/watch?v=BzcrBlUSHAo", | ||
"https://www.youtube.com/watch?v=YfzlR9X7Zfs", | ||
]; | ||
|
||
const Air = () => { | ||
return null; | ||
const [BBogumi, setBBogumi] = useState(0); | ||
const [pause, setPause] = useState(true); | ||
console.log(BBogumi); | ||
const next = () => { | ||
let total = 4; | ||
setBBogumi((prev) => (prev === total ? 0 : prev + 1)); | ||
}; | ||
const prev = () => { | ||
let total = 0; | ||
setBBogumi((prev) => (prev === total ? 4 : prev - 1)); | ||
}; | ||
const onPause = () => { | ||
setPause((prev) => !prev); | ||
}; | ||
return ( | ||
<div className="w-full h-screen bg-black"> | ||
<div className="w-full h-full relative top-20 overflow-hidden flex justify-center"> | ||
<ReactPlayer | ||
url={ArrayBBogumi[BBogumi]} | ||
volume={0.3} | ||
controls={false} | ||
playing={pause} | ||
muted={false} | ||
loop={true} | ||
width="90%" | ||
height="90%" | ||
></ReactPlayer> | ||
</div> | ||
<div | ||
onClick={next} | ||
className="w-3 h-[90%] xl:w-10 absolute top-[5rem] right-0 bg-red-500 hover:bg-green-500 flex justify-center items-center" | ||
> | ||
<ArrowForwardIosIcon /> | ||
</div> | ||
<div | ||
onClick={onPause} | ||
className="w-[calc(100%-0.75rem)] xl:w-[calc(100%-2.5rem)] h-[90%] absolute top-[5rem] flex justify-center items-center" | ||
></div> | ||
<div | ||
onClick={prev} | ||
className="w-3 h-[90%] xl:w-10 absolute top-[5rem] left-0 bg-red-500 hover:bg-green-500 flex justify-center items-center" | ||
> | ||
<ArrowBackIosIcon /> | ||
</div> | ||
<Footer /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Air; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -177,4 +177,4 @@ const Home = () => { | |
); | ||
}; | ||
|
||
export default Home; | ||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from "react"; | ||
import ReactPlayer from "react-player"; | ||
import { useQuery } from "react-query"; | ||
import { useParams } from "react-router-dom"; | ||
import { getMovieTrailer, IGetMoviesTrailer } from "../Api/Api"; | ||
import { makeTrailerPath } from "../Api/utils"; | ||
import Footer from "./Footer"; | ||
|
||
const Trailer = () => { | ||
const tailerID = useParams(); | ||
const { isLoading, data } = useQuery<IGetMoviesTrailer>("Trailer", () => | ||
getMovieTrailer(Number(tailerID.id)) | ||
); | ||
return ( | ||
<React.Fragment> | ||
{isLoading ? ( | ||
"Loading" | ||
) : ( | ||
<div className="w-full h-screen bg-black"> | ||
<div className="w-full h-full relative top-20 overflow-hidden flex justify-center"> | ||
<ReactPlayer | ||
url={ | ||
makeTrailerPath(data?.results[0].key || "") || | ||
"https://www.youtube.com/watch?v=NeKdhpmVI64" | ||
} | ||
volume={0} | ||
controls={false} | ||
playing={true} | ||
muted={false} | ||
loop={true} | ||
width="90%" | ||
height="90%" | ||
></ReactPlayer> | ||
</div> | ||
<div className="w-full h-full absolute top-0 "></div> | ||
<Footer /> | ||
</div> | ||
)} | ||
</React.Fragment> | ||
); | ||
}; | ||
|
||
export default Trailer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters