Skip to content

Commit

Permalink
feat: add layerContent prop
Browse files Browse the repository at this point in the history
Co-authored-by: zhangyue04 <zhangyue04@zhihu.com>
  • Loading branch information
TaraLoveCats and zhangyue04 authored Feb 17, 2022
1 parent c881b7a commit f85f3a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/griffith/src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import Video from './Video'
import Controller from './Controller'
import VolumeItem from './items/VolumeItem'
import MinimalTimeline from './MinimalTimeline'
import Layer from './Layer'
import getBufferedTime from '../utils/getBufferedTime'
import formatDuration from '../utils/formatDuration'
import storage from '../utils/storage'
Expand Down Expand Up @@ -81,6 +82,7 @@ type InnerPlayerProps = {
hideMobileControls?: boolean
hideCover?: boolean
noWriteDocTitle?: boolean
layerContent?: React.ReactNode
}

// 仅供 Provider 使用的属性
Expand Down Expand Up @@ -136,6 +138,7 @@ const InnerPlayer: React.FC<InnerPlayerProps> = ({
hideMobileControls,
hideCover,
noWriteDocTitle,
layerContent,
}) => {
const {emitEvent, subscribeAction} = useContext(InternalMessageContext)
const {currentSrc} = useContext(VideoSourceContext)
Expand Down Expand Up @@ -691,6 +694,7 @@ const InnerPlayer: React.FC<InnerPlayerProps> = ({
)}
{controlsOverlay}
<ActionToastOutlet />
{layerContent && <Layer>{layerContent}</Layer>}
{error && (
<div className={css(styles.error)}>
<Icon icon={displayIcons.alert} styles={styles.errorIcon} />
Expand Down

0 comments on commit f85f3a6

Please sign in to comment.