-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(kaltura): adding kaltura video player to gatsby (#4201)
* feat(kaltura): adding kaltura video player to gatsby * feat(kaltura): adding kaltura video player to gatsby * feat: update remaining 3 videos --------- Co-authored-by: Alison Joseph <[email protected]>
- Loading branch information
1 parent
0eb584e
commit 652640d
Showing
10 changed files
with
110 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from 'react'; | ||
import PropTypes from "prop-types"; | ||
|
||
/** | ||
* KalturaVideo component: A video player container for Kaltura videos. | ||
* | ||
* @param {object} videoProps - KalturaVideo component props | ||
* @param {string} videoProps.videoid - The ID of the Kaltura video to be played. | ||
* @param {boolean} videoProps.hideCaption - Determines if caption should be hidden. | ||
* @returns {JSX.Element} JSX element containing the video player container. | ||
*/ | ||
const KalturaVideo = ({ videoid, hideCaption = false }) => { | ||
let videoProps = { | ||
'video-id': videoid, | ||
} | ||
|
||
if (hideCaption) { | ||
videoProps['hide-caption'] = true; | ||
} | ||
|
||
return ( | ||
<div> | ||
<dds-video-player-container {...videoProps}></dds-video-player-container> | ||
</div> | ||
); | ||
}; | ||
|
||
/** | ||
* @typedef {object} KalturaVideoProps | ||
* | ||
* @property {string} videoid - The ID of the Kaltura video to be played. | ||
*/ | ||
KalturaVideo.propTypes = { | ||
hideCaption: PropTypes.bool, | ||
videoid: PropTypes.string.isRequired, | ||
}; | ||
|
||
/** | ||
* @type {{hideCaption: boolean}} | ||
*/ | ||
KalturaVideo.defaultProps = { | ||
hideCaption: false, | ||
} | ||
|
||
export default KalturaVideo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import KalturaVideo from './KalturaVideo'; | ||
|
||
export default KalturaVideo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.