Merge pull request #42 from the-rarbg/seo_work

tv and movies play with tmdb
This commit is contained in:
Wizard 2023-09-22 18:24:31 +05:30 committed by GitHub
commit 4eb98cabf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 23 deletions

View file

@ -7,7 +7,7 @@ import { FaImdb, FaLink, FaPlay } from 'react-icons/fa'
const FilmResources = (props)=> {
const router = useRouter()
const [loader,setLoader]=useState(false)
const handlegetLink =()=>{
props?.handleClose()
}
@ -31,10 +31,18 @@ const handlegetLink =()=>{
</a>
)}
{!props?.imdb ? null : (
{!(props?.imdb||props?.tmdb) ? null : (
<a
onClick={()=>router.push(`/streaming?id=${props?.imdb}`)}
onClick={()=>{
if(router?.pathname==="/tv/[id]"){
router.push(`/play/tv/?${props?.tmdb?(`tmdb=${props?.tmdb}`):(`id=${props?.imdb}`)}`)
}
else{
router.push(`/play/movies/?${props?.tmdb?(`tmdb=${props?.tmdb}`):(`id=${props?.imdb}`)}`)
}
}}
className='mb-4 mr-4 flex w-40 cursor-pointer items-center justify-between rounded-md border-none bg-app-greyish-blue py-3 px-8 text-sm font-light text-app-pure-white hover:bg-app-pure-white hover:text-app-dark-blue'
rel='noreferrer'

20
pages/play/movies.js Normal file
View file

@ -0,0 +1,20 @@
import React from 'react'
import { useRouter } from 'next/router';
import Head from 'next/head'
const Movies = () => {
const router = useRouter()
const { id,tmdb} = router.query;
return (
<>
<Head>
<title>Play Movies | Yaps</title>
</Head>
<iframe src={`https://vidsrc.me/embed/movie?${tmdb?`tmdb=${tmdb}`:`imdb=${id}`}`} frameBorder="0" style={{width: '100%' ,height: '92vh'}} allowfullscreen="allowfullscreen"></iframe>
</>
)
}
export default Movies

18
pages/play/tv.js Normal file
View file

@ -0,0 +1,18 @@
import React from 'react'
import { useRouter } from 'next/router';
import Head from 'next/head'
const Tv = () => {
const router = useRouter()
const { id,tmdb} = router.query;
return (
<>
<Head>
<title>Play Tv | Yaps</title>
</Head>
<iframe src={`https://vidsrc.me/embed/tv?${tmdb?(`tmdb=${tmdb}`):(`imdb=${id}`)}`} frameBorder="0" style={{width: '100%' ,height: '92vh'}} allowfullscreen="allowfullscreen"></iframe>
</>
)
}
export default Tv

View file

@ -1,20 +0,0 @@
import React from 'react'
import { useRouter } from 'next/router';
import Head from 'next/head'
const Streaming = () => {
const router = useRouter()
const { id } = router.query;
return (
< >
<Head>
<title>Streaming | Yaps</title>
</Head>
<iframe src={`https://vidsrc.me/embed/movie?imdb=${id}`} frameBorder="0" style={{width: '100%' ,height: '92vh'}} allowfullscreen="allowfullscreen"></iframe>
</>
)
}
export default Streaming

View file

@ -50,6 +50,8 @@ export default function TV() {
<FilmResources
website={tv.detail.homepage}
imdb={tv.detail.imdb_id}
tmdb={id}
path={router.pathname}
/>
</section>
</section>