Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 1x 26x 17x 9x 9x 9x 8x 8x 8x 1x | const useGetSrcWithMediaFragments = ({videoSrc, timeOffset, timeLimit}) => { const isEmpty = param => param === undefined || param === null const isNotEmpty = param => !isEmpty(param) let timeOffsetParam = timeOffset if (isEmpty(timeOffset) && isNotEmpty(timeLimit)) timeOffsetParam = '0' if (isNotEmpty(videoSrc)) { const timeLimitParam = timeLimit ? `,${timeLimit}` : '' timeOffsetParam = timeOffsetParam ? `#t=${timeOffsetParam}` : '' return `${videoSrc}${timeOffsetParam}${timeLimitParam}` } return null } export default useGetSrcWithMediaFragments |