Commit 763ba7e 1 parent 99851bf commit 763ba7e Copy full SHA for 763ba7e
File tree 3 files changed +59
-2
lines changed
3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,58 @@ export const EpgsRenderer: InitPlugin["renderer"] = ({
46
46
return
47
47
} ,
48
48
components : [
49
+ /*{
50
+ id: `${EPGS_PREFIX}.okkake`,
51
+ position: "onPlayer",
52
+ component: () => {
53
+ const playingContent = useRecoilValue(
54
+ atoms.contentPlayerPlayingContentAtom
55
+ )
56
+ const position = useRecoilValue(
57
+ atoms.contentPlayerPlayingPositionSelector
58
+ )
59
+ const positionRef = useRefFromState(position)
60
+ const setPosition = useSetRecoilState(
61
+ atoms.contentPlayerPositionUpdateTriggerAtom
62
+ )
63
+ useEffect(() => {
64
+ if (
65
+ !playingContent ||
66
+ playingContent.contentType !== "EPGStation" ||
67
+ !playingContent.program ||
68
+ dayjs().isAfter(
69
+ playingContent.program.startAt + playingContent.program.duration
70
+ )
71
+ ) {
72
+ return
73
+ }
74
+ const endAt =
75
+ playingContent.program.startAt + playingContent.program.duration
76
+ console.info("[epgs] ่ฟฝใฃใใๅ็ใขใผใใ้ๅงใใพใ")
77
+ let isSeeked = false
78
+ const timer = setInterval(() => {
79
+ const position = positionRef.current
80
+ console.log("position", position)
81
+ if (dayjs().isAfter(endAt)) {
82
+ console.info(
83
+ "[epgs] ๆพ้ใ็ตไบใใพใใใ่ฟฝใฃใใๅ็ใขใผใใ็ตไบใใพใ"
84
+ )
85
+ clearInterval(timer)
86
+ return
87
+ }
88
+ if (!isSeeked && 0.99 < position) {
89
+ console.info("[epgs] ็ฏๅฒใๅๅๅพใใพใ:")
90
+ setPosition(0.8)
91
+ isSeeked = true
92
+ }
93
+ }, 5000)
94
+ return () => {
95
+ clearInterval(timer)
96
+ }
97
+ }, [playingContent])
98
+ return <></>
99
+ },
100
+ },*/
49
101
{
50
102
id : `${ EPGS_PREFIX } .settings` ,
51
103
position : "onSetting" ,
Original file line number Diff line number Diff line change @@ -57,7 +57,12 @@ export const RecordDetail: React.VFC<{
57
57
const play = useCallback (
58
58
( videoId : number , isNewWindow : boolean ) => {
59
59
const url = api . getVideoUrl ( { videoId } )
60
- const program = convertProgramRecordToProgram ( record , service )
60
+ const now = dayjs ( )
61
+ const endAt = now . isAfter ( record . endAt ) ? record . endAt : now . unix ( ) * 1000
62
+ const program = convertProgramRecordToProgram (
63
+ { ...record , endAt } ,
64
+ service
65
+ )
61
66
const payload = {
62
67
contentType : "EPGStation" ,
63
68
url,
Original file line number Diff line number Diff line change @@ -401,7 +401,7 @@ export const EPGS_META = {
401
401
id : EPGS_ID ,
402
402
name : "EPGStation" ,
403
403
author : "ci7lus" ,
404
- version : "0.1.4 " ,
404
+ version : "0.1.5 " ,
405
405
description : "EPGStationใฎ้ฒ็ปใๅ็ใใใใใฎใใฉใฐใคใณใงใใ" ,
406
406
authorUrl : "https://github.com/ci7lus" ,
407
407
url : "https://github.com/ci7lus/miraktest-plugins/tree/master/src/miraktest-epgs" ,
You canโt perform that action at this time.
0 commit comments