fix: vidéos ne marche plus sur les pages résistants
parent
5982b04bb5
commit
4160039833
|
@ -1,2 +1,5 @@
|
|||
export const getYoutubeLink = (id: string): string =>
|
||||
`https://www.youtube.com/watch?v=${id}`;
|
||||
|
||||
export const getYoutubeEmbedLink = (id: string): string =>
|
||||
`https://www.youtube-nocookie.com/embed/${id}`;
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
import { useContext } from "react";
|
||||
import { useNavigate, useParams } from "react-router";
|
||||
import { AspectRatio } from "@mantine/core";
|
||||
import { getResistantPhotoUrl } from "../getResistantPhotoUrl";
|
||||
import { resistants } from "../resistants";
|
||||
import { getResistantsPageUrl } from "../getResistantsPageUrl";
|
||||
import { HomeContext } from "../context/HomeContext";
|
||||
import { AspectRatio } from "@mantine/core";
|
||||
import { ExternalLink } from "../components/ExternalLink";
|
||||
import {
|
||||
getResistantDateDeclarationMoisAnnee,
|
||||
getResistantDateFinMoisAnnee,
|
||||
isAncienResistant,
|
||||
isResistantActif,
|
||||
} from "../Resistant";
|
||||
import { getYoutubeEmbedLink } from "../Youtube";
|
||||
|
||||
export const PageResistant = () => {
|
||||
const { idResistant } = useParams();
|
||||
|
@ -172,9 +172,7 @@ export const PageResistant = () => {
|
|||
style={{ marginLeft: "auto", marginRight: "auto" }}
|
||||
>
|
||||
<iframe
|
||||
src={`https://www.youtube-nocookie.com/embed/${
|
||||
resistant.video.split("watch?v=")[1]
|
||||
}`}
|
||||
src={getYoutubeEmbedLink(resistant.video)}
|
||||
width="100%"
|
||||
height="100%"
|
||||
title="YouTube video player"
|
||||
|
|
Loading…
Reference in New Issue