Skip to content

Commit

Permalink
fix: prefix video sources in production (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicone authored Aug 29, 2019
1 parent d857a09 commit 131a970
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/gatsby-theme-carbon/src/components/Video/Video.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import cx from 'classnames';
import Player from '@vimeo/player';
import { withPrefix } from 'gatsby';
import {
video,
videoButton,
Expand All @@ -11,7 +12,7 @@ import {
videoIsPlaying,
} from './Video.module.scss';

const Video = ({ vimeoId, title, ...props }) => {
const Video = ({ vimeoId, title, src, ...props }) => {
const [isPlaying, setIsPlaying] = useState(false);
const videoRef = useRef(null);
const iframeRef = useRef(null);
Expand Down Expand Up @@ -189,6 +190,7 @@ const Video = ({ vimeoId, title, ...props }) => {
ref={videoRef}
controls
onEnded={onEnded}
src={withPrefix(src)}
{...props}
/>
</div>
Expand Down

1 comment on commit 131a970

@vercel
Copy link

@vercel vercel bot commented on 131a970 Aug 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.