mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(spf): HLS engine composition walkthrough + doc-driven cleanups (#1512)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
17d44a5d32
commit
0cfd3bb395
@@ -1,8 +1,8 @@
|
||||
'use client';
|
||||
|
||||
import { SimpleHlsMedia } from '@videojs/core/dom/media/simple-hls';
|
||||
import type { SpfMediaProps } from '@videojs/spf/dom';
|
||||
import { spfMediaDefaultProps } from '@videojs/spf/dom';
|
||||
import type { SimpleHlsMediaProps } from '@videojs/spf/hls';
|
||||
import { simpleHlsMediaDefaultProps } from '@videojs/spf/hls';
|
||||
import type { ReactNode, VideoHTMLAttributes } from 'react';
|
||||
import { forwardRef } from 'react';
|
||||
import { useAttachMedia } from '../../utils/use-attach-media';
|
||||
@@ -11,8 +11,8 @@ import { useMediaInstance } from '../../utils/use-media-instance';
|
||||
import { useSyncProps } from '../../utils/use-sync-props';
|
||||
|
||||
export interface SimpleHlsVideoProps
|
||||
extends Omit<VideoHTMLAttributes<HTMLVideoElement>, keyof SpfMediaProps>,
|
||||
Partial<SpfMediaProps> {
|
||||
extends Omit<VideoHTMLAttributes<HTMLVideoElement>, keyof SimpleHlsMediaProps>,
|
||||
Partial<SimpleHlsMediaProps> {
|
||||
children?: ReactNode;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ export const SimpleHlsVideo = forwardRef<HTMLVideoElement, SimpleHlsVideoProps>(
|
||||
const media = useMediaInstance(SimpleHlsMedia);
|
||||
const attachRef = useAttachMedia(media);
|
||||
const composedRef = useComposedRefs(attachRef, ref);
|
||||
const htmlProps = useSyncProps(media, props, spfMediaDefaultProps);
|
||||
const htmlProps = useSyncProps(media, props, simpleHlsMediaDefaultProps);
|
||||
|
||||
return (
|
||||
<video ref={composedRef} {...htmlProps}>
|
||||
|
||||
Reference in New Issue
Block a user