Skip to content

Commit

Permalink
Merge pull request #414 from MTES-MCT/fix/firefox_video_format
Browse files Browse the repository at this point in the history
Fix/firefox video format
  • Loading branch information
gaspard-lonchampt authored Sep 28, 2023
2 parents da08d36 + c3098d6 commit 8e0b945
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.mp4 filter=lfs diff=lfs merge=lfs -text
*.webm filter=lfs diff=lfs merge=lfs -text
*.ogv filter=lfs diff=lfs merge=lfs -text
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
16 changes: 13 additions & 3 deletions web/landing/ResourcePage/VideoCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,15 @@ import { resourceCardsClasses } from "./styles/ResourceCardsStyle";
import { useMatomo } from "@datapunt/matomo-tracker-react";
import { PLAY_VIDEO } from "common/utils/matomoTags";

export function VideoCard({ video, description, poster, matomoTag, ...props }) {
export function VideoCard({
video_mp4,
video_webm,
video_ogv,
description,
poster,
matomoTag,
...props
}) {
const classes = resourceCardsClasses();
const { trackEvent } = useMatomo();

Expand All @@ -26,10 +34,12 @@ export function VideoCard({ video, description, poster, matomoTag, ...props }) {
preload="metadata"
onPlay={clickEvent}
>
<source src={video} type="video/mp4" />
<source src={video_mp4} type="video/mp4" />
<source src={video_webm} type="video/webm" />
<source src={video_ogv} type="video/ogv" />
<p>
Votre navigateur ne prend pas en charge les vidéos HTML5. Voici{" "}
<a href={video}>un lien pour télécharger la vidéo</a>
<a href={video_mp4}>un lien pour télécharger la vidéo</a>
</p>
</video>
</Card>
Expand Down
16 changes: 12 additions & 4 deletions web/landing/sections/IntroSection.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ import { makeStyles } from "@mui/styles";
import { useIsWidthDown } from "common/utils/useWidth";
import { VideoCard } from "../ResourcePage/VideoCard";

import MobilicVideo from "common/assets/videos/accueil/accueil-qu-est-ce-que-mobilic.mp4";
import MobilicVideo_mp4 from "common/assets/videos/accueil/accueil-qu-est-ce-que-mobilic.mp4";
import MobilicVideo_webm from "common/assets/videos/accueil/accueil-qu-est-ce-que-mobilic.webm";
import MobilicVideo_ogv from "common/assets/videos/accueil/accueil-qu-est-ce-que-mobilic.ogv";
import MobilicPoster from "common/assets/videos/accueil/accueil-qu-est-ce-que-mobilic-preview.jpg";
import ReglementationVideo from "common/assets/videos/accueil/accueil-reglementaire.mp4";
import ReglementationVideo_mp4 from "common/assets/videos/accueil/accueil-reglementaire.mp4";
import ReglementationVideo_webm from "common/assets/videos/accueil/accueil-reglementaire.webm";
import ReglementationVideo_ogv from "common/assets/videos/accueil/accueil-reglementaire.ogv";
import ReglementationPoster from "common/assets/videos/accueil/accueil-reglementaire-preview.jpg";

const useStyles = makeStyles(theme => ({
Expand Down Expand Up @@ -182,14 +186,18 @@ export function IntroSection() {
<Grid item xs={12} sm={6}>
<VideoCard
description="Mobilic, qu'est-ce que c'est ?"
video={MobilicVideo}
video_mp4={MobilicVideo_mp4}
video_webm={MobilicVideo_webm}
video_ogv={MobilicVideo_ogv}
poster={MobilicPoster}
/>
</Grid>
<Grid item xs={12} sm={6}>
<VideoCard
description="Mobilic est-il conforme à la réglementation ?"
video={ReglementationVideo}
video_mp4={ReglementationVideo_mp4}
video_webm={ReglementationVideo_webm}
video_ogv={ReglementationVideo_ogv}
poster={ReglementationPoster}
/>
</Grid>
Expand Down

0 comments on commit 8e0b945

Please sign in to comment.