From 367b24b45bf3fb65c8db62d3614cdfdd36a8b861 Mon Sep 17 00:00:00 2001 From: lgf <18827634408@163.com> Date: Wed, 11 Aug 2021 11:49:58 +0800 Subject: [PATCH] add video modification url method --- src/appComponent.tsx | 22 +++++++++++++--------- src/core/index.tsx | 4 ++-- src/core/useVideo.ts | 3 +++ src/interface/index.ts | 8 ++++++++ 4 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/appComponent.tsx b/src/appComponent.tsx index 93369a7..e0beadd 100644 --- a/src/appComponent.tsx +++ b/src/appComponent.tsx @@ -1,8 +1,11 @@ -import React, { memo, useRef, useEffect, useMemo } from 'react'; +import React, { memo, useRef, useEffect, useMemo, useState } from 'react'; import JoLPlayer, { JoLPlayerType } from './app'; import '@/icons/'; const AppComponent = memo(function AppComponent(props) { + const url = useRef( + 'https://gs-files.oss-cn-hongkong.aliyuncs.com/okr/test/file/2021/07/01/haiwang.mp4', + ); const videoRef = useRef(null!); const onProgressMouseDown: JoLPlayerType.callBackType = (val) => { @@ -24,6 +27,13 @@ const AppComponent = memo(function AppComponent(props) { // console.log(`onTimeChange`, val); }; const onEndEd = (val: any) => { + setTimeout(() => { + videoRef.current.setVideoSrc( + 'https://gs-files.oss-accelerate.aliyuncs.com/okr/prod/file/2021/08/10/1628605591454mda-met51bhiqb2sgjzd.mp4', + ); + videoRef.current.play(); + }, 1000); + console.log(`onEndEd`, val); }; const onError = () => { @@ -51,12 +61,6 @@ const AppComponent = memo(function AppComponent(props) { }; useEffect(() => { if (videoRef.current) { - setTimeout(() => { - videoRef.current.video.play(); - }, 1000); - - console.log(`object`, videoRef.current.play); - // videoRef.current.play(); } console.log(`videoRef.current`, videoRef.current); @@ -66,11 +70,11 @@ const AppComponent = memo(function AppComponent(props) {
-