https://github.com/cloudinary-community ... deo-player
с той лишь разницей, что я хочу сделать это для частного видео
Вот шаги, которые я выполнил:
- загрузил видео в Cloudinary через портал, отметьте это как личное

- добавьте следующий код в index.html
вв добавьтеКод: Выделить всё
Код: Выделить всё
- Создайте VideoPlayer.js
Использовать в файле tsx
Код: Выделить всё
import { useEffect, useRef } from 'react'; function VideoPlayer(props) { const { width , height } = props; const cloudinaryRef = useRef(); const videoRef = useRef(); useEffect(() => { if (cloudinaryRef.current ) return; cloudinaryRef.current = window.cloudinary; cloudinaryRef.current.videoPlayer(videoRef.current, { cloud_name: 'abc-examples' }) }, []); return ( ) } export default VideoPlayer;Код: Выделить всё
{word.youtubeVideoId && ( Video Example: )}
react-dom_client.js?v=f1a2239a:16716 Uncaught TypeError: невозможно прочитать
свойства неопределенного значения (чтение «videoPlayer») в
VideoPlayer.tsx:11:31 (анонимно) @ VideoPlayer.tsx:11
Я не уверен, почему возникла ошибка.
Подробнее здесь: https://stackoverflow.com/questions/798 ... ct-web-app
Мобильная версия