Skip to content

Commit

Permalink
Add type for videourl
Browse files Browse the repository at this point in the history
  • Loading branch information
huy232 committed Feb 11, 2024
1 parent 38ec43b commit 0b0eb5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Components/Content/ArtPlayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ function ArtPlayer({
const artRef = useRef()

useEffect(() => {
if (videoUrl[0].url.includes(".mp4")) {
if (
videoUrl[0].url.includes(".mp4") ||
videoUrl[0].isM3U8 === false ||
videoUrl[0].type === "mp4"
) {
const art = new Artplayer({
...option,
url: videoUrl[0].url,
Expand Down
6 changes: 6 additions & 0 deletions src/Pages/AnimeWatch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function AnimeWatch({ instance }) {
default: true,
url: response.data.data.videoSource,
html: response.data.data.quality,
isM3U8: response.data.data.isM3U8,
type: response.data.data.type,
},
])
} else {
Expand Down Expand Up @@ -137,6 +139,8 @@ function AnimeWatch({ instance }) {
{
url: res.data.data.videoSource,
html: res.data.data?.quality ? res.data.data.quality : "",
isM3U8: res.data.data.isM3U8,
type: res.data.data.type,
},
])
setVideoLoading(false)
Expand Down Expand Up @@ -164,6 +168,8 @@ function AnimeWatch({ instance }) {
{
url: res.data.data.videoSource,
html: res.data.data?.quality ? res.data.data.quality : "",
isM3U8: res.data.data.isM3U8,
type: res.data.data.type,
},
])
setVideoLoading(false)
Expand Down

0 comments on commit 0b0eb5e

Please sign in to comment.