视频弹窗答题

main
king 1 year ago
parent 8ad043d735
commit f2cf8b6486
  1. 10
      src/components/topic/single.tsx
  2. 7
      src/components/video/type.ts
  3. 7
      src/components/video/video.tsx
  4. 9
      src/pages/business/videoInfo/components/course.tsx
  5. 5
      src/pages/business/videoInfo/videoInfo.scss

@ -0,0 +1,10 @@
import {FC} from "react";
import {View} from "@tarojs/components";
export const Single:FC = ()=>{
return(
<View>1</View>
)
}
export default Single

@ -1,3 +1,5 @@
import {ReactNode} from "react";
export interface HVideoOptions {
/** 视频时长s */
duration: number
@ -9,11 +11,10 @@ export interface HVideoOptions {
poster?: string
/** 视频断点 */
breakpoint: number[]
/** 进入断点 */
onBreakpoint: (id: number) => void
/** 视频播放结束 */
onEnded: () => void
setTime: (fn:(time:number)=>void) => void
setTime: (fn: (time: number) => void) => void
children?: ReactNode
}

@ -48,7 +48,8 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
if (process.env.TARO_ENV === 'h5') {
try {
document?.exitFullscreen().then()
} catch (e) {}
} catch (e) {
}
}
video?.exitFullScreen()
opt.onBreakpoint(d)
@ -122,7 +123,9 @@ const HVideo: FC<HVideoOptions> = (opt: HVideoOptions) => {
onEnded={onEnded}
onPlay={onPlay}
onPause={onPause}
/>
>
{opt.children}
</Video>
</>
)
}

@ -1,4 +1,4 @@
import {ScrollView, Text, View} from "@tarojs/components";
import {CoverView, ScrollView, Text, View} from "@tarojs/components";
import {FC, useEffect, useState} from "react";
import HVideo from "@/components/video/video";
import {curriculum, HourPlayData} from "@/api";
@ -9,6 +9,7 @@ import unique_ident from "@/hooks/unique_ident";
import MyButton from "@/components/button/MyButton";
import {formatMinute} from "@/utils/time";
import CustomPageContainer from "@/components/custom-page-container/custom-page-container";
import Single from "@/components/topic/single";
interface Props {
id: number,
@ -127,7 +128,11 @@ const Course: FC<Props> = ({id, courseId, preview, curEnd}) => {
breakpoint={breakpoint}
onBreakpoint={onBreakpoint}
setTime={videoSeek}
/>
>
{/*<CoverView className='single-cover'>*/}
{/* <Single/>*/}
{/*</CoverView>*/}
</HVideo>
<CustomPageContainer show={show} position='bottom'>
<View>

@ -106,3 +106,8 @@
filter: saturate(0);
}
.single-cover {
position: absolute;
color: #fff;
}

Loading…
Cancel
Save