-
Notifications
You must be signed in to change notification settings - Fork 785
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 (#4191)
* feat(kaltura): adding kaltura video player to gatsby * fix(kaltura): switch to v1 kaltura player for now * chore(kaltura): swapping motion videos * chore(kaltura): adding videos for 2x grid * chore(kaltura): adding color overview * chore(kaltura): adding motion - choreography videos * chore(kaltura): remove excess comments --------- Co-authored-by: Alison Joseph <alison.joseph@us.ibm.com>
- Loading branch information
1 parent
1649cf9
commit 2c95b3b
Showing
9 changed files
with
104 additions
and
43 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
Oops, something went wrong.