@mux/mux-player-react 3.4.1 → 3.4.2-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/-WMXQZQZY.mjs +2 -0
- package/dist/-WMXQZQZY.mjs.map +7 -0
- package/dist/ads.cjs.js +2 -0
- package/dist/ads.cjs.js.map +7 -0
- package/dist/ads.mjs +2 -0
- package/dist/ads.mjs.map +7 -0
- package/dist/cjs.ads.json +108 -0
- package/dist/esm.ads.json +110 -0
- package/dist/esm.lazy.json +37 -13
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +4 -4
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +4 -4
- package/dist/lazy.mjs +1 -1
- package/dist/news/cjs.json +101 -0
- package/dist/news/esm.json +103 -0
- package/dist/news/index.cjs.js +217 -0
- package/dist/news/index.cjs.js.map +7 -0
- package/dist/news/index.mjs +217 -0
- package/dist/news/index.mjs.map +7 -0
- package/dist/themes/news.cjs.js +2 -0
- package/dist/themes/news.cjs.js.map +7 -0
- package/dist/themes/news.mjs +2 -0
- package/dist/themes/news.mjs.map +7 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ads.d.ts +27 -0
- package/dist/types/index.d.ts +2 -113
- package/dist/types/news/index.d.ts +14 -0
- package/dist/types/news/playlist-end-screen.d.ts +11 -0
- package/dist/types/themes/news.d.ts +3 -0
- package/dist/types/types.d.ts +118 -0
- package/dist/types/useEventCallbackEffect.d.ts +4 -0
- package/dist/types-ts3.4/ads.d.ts +27 -0
- package/dist/types-ts3.4/index.d.ts +2 -113
- package/dist/types-ts3.4/news/index.d.ts +14 -0
- package/dist/types-ts3.4/news/playlist-end-screen.d.ts +11 -0
- package/dist/types-ts3.4/themes/news.d.ts +3 -0
- package/dist/types-ts3.4/types.d.ts +118 -0
- package/dist/types-ts3.4/useEventCallbackEffect.d.ts +4 -0
- package/package.json +29 -13
- package/dist/-NM4RRKFI.mjs +0 -2
- package/dist/-NM4RRKFI.mjs.map +0 -7
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";var P=Object.create;var c=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var E=(t,i)=>{for(var o in i)c(t,o,{get:i[o],enumerable:!0})},y=(t,i,o,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of V(i))!z.call(t,l)&&l!==o&&c(t,l,{get:()=>i[l],enumerable:!(r=N(i,l))||r.enumerable});return t};var p=(t,i,o)=>(o=t!=null?P(I(t)):{},y(i||!t||!t.__esModule?c(o,"default",{value:t,enumerable:!0}):o,t)),C=t=>y(c({},"__esModule",{value:!0}),t);var j={};E(j,{default:()=>U});module.exports=C(j);var a=p(require("react")),b=p(require("@mux/mux-player-react/ads")),v=p(require("@mux/mux-player-react/themes/news"));var e=p(require("react"));var f=`/* Main Playlist Container */
|
|
2
|
+
.playlist {
|
|
3
|
+
/* Ensure it wraps on smaller screens */
|
|
4
|
+
display: inline;
|
|
5
|
+
position: relative;
|
|
6
|
+
background-color: #12121263;
|
|
7
|
+
z-index: 2;
|
|
8
|
+
top: 0;
|
|
9
|
+
position: absolute;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (min-width: 1336px) {
|
|
15
|
+
.playlist {
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.overlay {
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
background: black;
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.post-video-section {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: 1fr auto 1fr;
|
|
33
|
+
padding: 1.5rem 2rem;
|
|
34
|
+
position: relative;
|
|
35
|
+
gap: 1rem;
|
|
36
|
+
padding: 1.5rem 2rem;
|
|
37
|
+
height: max-content;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
z-index: 2;
|
|
40
|
+
max-width: 1200px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.post-video-section hr {
|
|
44
|
+
border: none;
|
|
45
|
+
background: rgba(255, 255, 255, 0.5);
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 1px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Video Section */
|
|
51
|
+
.video-section {
|
|
52
|
+
flex: 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.video-container {
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.title {
|
|
60
|
+
font-size: 2.5rem;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
line-height: 3rem;
|
|
63
|
+
margin: 0;
|
|
64
|
+
margin-bottom: 1rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.video-wrapper {
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 100%;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.video-container > .video-title {
|
|
74
|
+
font-size: 1.3rem;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.video-thumbnail {
|
|
79
|
+
width: 100%;
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.video-title {
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
margin-top: 0.5rem;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
color: #ffffff;
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
line-height: 1.4;
|
|
90
|
+
/* Adjusted for better readability */
|
|
91
|
+
word-wrap: break-word;
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
margin-bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.video-title:hover {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Countdown Timer */
|
|
101
|
+
.countdown-overlay {
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 50%;
|
|
104
|
+
left: 50%;
|
|
105
|
+
transform: translate(-50%, -50%);
|
|
106
|
+
width: 3.75rem;
|
|
107
|
+
height: 3.75rem;
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.countdown-ring {
|
|
114
|
+
position: absolute;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.circle-background {
|
|
118
|
+
fill: none;
|
|
119
|
+
stroke: rgba(255, 255, 255, 0.2);
|
|
120
|
+
stroke-width: 0.25rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.circle-progress {
|
|
124
|
+
fill: none;
|
|
125
|
+
stroke: #00a3dd;
|
|
126
|
+
stroke-width: 0.25rem;
|
|
127
|
+
stroke-linecap: round;
|
|
128
|
+
transition: stroke-dashoffset 1s linear;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.count-text {
|
|
132
|
+
position: absolute;
|
|
133
|
+
font-size: 1rem;
|
|
134
|
+
font-weight: bold;
|
|
135
|
+
color: #ffffff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Related Videos */
|
|
139
|
+
.related-videos-section {
|
|
140
|
+
flex: 1;
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.related-title {
|
|
145
|
+
font-size: 1.125rem;
|
|
146
|
+
font-weight: bold;
|
|
147
|
+
margin: 0;
|
|
148
|
+
line-height: 2rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.related-list {
|
|
152
|
+
list-style: none;
|
|
153
|
+
padding: 0;
|
|
154
|
+
margin: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.related-item {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: start;
|
|
160
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
|
|
161
|
+
width: 100%;
|
|
162
|
+
gap: 0.5rem;
|
|
163
|
+
padding: 0.5rem 0;
|
|
164
|
+
border-radius: 0;
|
|
165
|
+
background: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.related-item:hover {
|
|
169
|
+
background: none;
|
|
170
|
+
}
|
|
171
|
+
.related-thumbnail {
|
|
172
|
+
width: 7rem;
|
|
173
|
+
object-fit: cover;
|
|
174
|
+
aspect-ratio: 16 / 9;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.related-text {
|
|
178
|
+
font-size: 0.9rem;
|
|
179
|
+
color: white;
|
|
180
|
+
line-height: 1.4;
|
|
181
|
+
word-wrap: break-word;
|
|
182
|
+
max-width: 100%;
|
|
183
|
+
margin-top: 0.25rem;
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.related-text:hover {
|
|
188
|
+
text-decoration: underline;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Responsive */
|
|
192
|
+
|
|
193
|
+
@media (max-width: 768px) {
|
|
194
|
+
.post-video-section {
|
|
195
|
+
grid-template-columns: 1fr;
|
|
196
|
+
margin: auto;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.post-video-section h2 {
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
hr {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.video-section {
|
|
208
|
+
width: 60%;
|
|
209
|
+
margin: auto;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.related-videos-section {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;var T=({video:t,relatedVideos:i,isVisible:o,selectVideoCallback:r,timerCallback:l})=>{let[s,d]=(0,e.useState)(3);return(0,e.useEffect)(()=>{if(!o){d(3);return}if(s<0){l();return}let n=setInterval(()=>{d(m=>Math.max(m-1,-1))},1e3);return()=>clearInterval(n)},[s,o]),e.default.createElement(e.default.Fragment,null,e.default.createElement("style",null,f),e.default.createElement("div",{className:"playlist",style:{display:o?"grid":"none"}},e.default.createElement("div",{className:"overlay",style:{display:o?"grid":"none"}}),e.default.createElement("div",{className:"post-video-section",style:{display:o?"grid":"none",zIndex:99}},e.default.createElement("div",{className:"video-section"},e.default.createElement("div",{className:"video-container"},e.default.createElement("h2",{className:"title"},"Video"),e.default.createElement("div",{className:"video-wrapper"},e.default.createElement("img",{className:"video-thumbnail",src:t.imageUrl,alt:t.title}),e.default.createElement("div",{className:"countdown-overlay"},e.default.createElement("svg",{className:"countdown-ring",width:"50",height:"50"},e.default.createElement("circle",{cx:"25",cy:"25",r:"22",className:"circle-background"}),e.default.createElement("circle",{cx:"25",cy:"25",r:"22",className:"circle-progress",style:{strokeDasharray:"138",strokeDashoffset:`${s/3*138}`}})),e.default.createElement("span",{className:"count-text"},s))),e.default.createElement("p",{className:"video-title"},t.title))),e.default.createElement("hr",null),e.default.createElement("div",{className:"related-videos-section"},e.default.createElement("h3",{className:"related-title"},"Related Videos"),e.default.createElement("ul",{className:"related-list"},i.map((n,m)=>e.default.createElement("li",{key:m},e.default.createElement("button",{className:"related-item",onClick:()=>r(m)},e.default.createElement("img",{className:"related-thumbnail",src:n.imageUrl,alt:n.title}),e.default.createElement("p",{className:"related-text"},n.title)))))))))},h=T;var M=({videoList:t,...i})=>{let o=(0,a.useRef)(null),[r,l]=(0,a.useState)(0),[s,d]=(0,a.useState)(!1),[n,m]=(0,a.useState)(0);function x(){d(!1),l(r+1),setTimeout(()=>{try{o.current.play()}catch{}},200)}function w(u){d(!1),l(u),setTimeout(()=>{try{o.current.play()}catch{}},200)}return a.default.createElement(b.default,{theme:v.default,style:{aspectRatio:"16/9"},preferPlayback:"mse",maxResolution:"2160p",minResolution:"540p",renditionOrder:"desc",metadata:{video_title:t[r].title},...i,ref:o,key:`player-${n}`,playbackId:t[r].playbackId,adTagUrl:t[r].adTagUrl,onEnded:u=>{var g;r<t.length-1?d(!0):(l(0),m(k=>k+1)),(g=i.onEnded)==null||g.call(i,u)}},a.default.createElement(h,{video:r<t.length-1?t[r+1]:t[0],relatedVideos:t,isVisible:s,selectVideoCallback:w,timerCallback:x}))},U=M;
|
|
217
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/news/index.tsx", "../../src/news/playlist-end-screen.tsx", "../../src/news/playlist-end-screen.css"],
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useState } from 'react';\nimport MuxPlayer, { MuxPlayerProps } from '@mux/mux-player-react/ads';\nimport NewsTheme from '@mux/mux-player-react/themes/news';\nimport PlaylistEndScreen from './playlist-end-screen';\n\nexport interface VideoItem {\n imageUrl: string;\n title: string;\n playbackId: string;\n adTagUrl: string;\n}\n\nexport type PlaylistVideos = VideoItem[];\n\nexport interface PlaylistProps extends Omit<MuxPlayerProps, 'playbackId' | 'adTagUrl'> {\n videoList: PlaylistVideos;\n}\n\nconst MuxNewsPlayer = ({ videoList, ...props }: PlaylistProps) => {\n const mediaElRef = useRef<any>(null);\n const [currentIndex, setCurrentIndex] = useState(0);\n const [isEndScreenVisible, setIsEndScreenVisible] = useState(false);\n const [playerKey, setPlayerKey] = useState(0);\n\n function playVideo() {\n setIsEndScreenVisible(false);\n setCurrentIndex(currentIndex + 1);\n setTimeout(() => {\n try {\n mediaElRef.current.play();\n } catch {\n // Ignore AbortError: The play() request was interrupted by a call to pause()\n }\n }, 200);\n }\n\n function selectVideo(index: number) {\n setIsEndScreenVisible(false);\n setCurrentIndex(index);\n setTimeout(() => {\n try {\n mediaElRef.current.play();\n } catch {\n // Ignore AbortError: The play() request was interrupted by a call to pause()\n }\n }, 200);\n }\n\n return (\n <MuxPlayer\n theme={NewsTheme}\n style={{ aspectRatio: '16/9' }}\n preferPlayback=\"mse\"\n maxResolution=\"2160p\"\n minResolution=\"540p\"\n renditionOrder=\"desc\"\n metadata={{\n video_title: videoList[currentIndex].title,\n }}\n {...props}\n ref={mediaElRef}\n key={`player-${playerKey}`}\n playbackId={videoList[currentIndex].playbackId}\n adTagUrl={videoList[currentIndex].adTagUrl}\n onEnded={(event) => {\n if (currentIndex < videoList.length - 1) {\n setIsEndScreenVisible(true);\n } else {\n setCurrentIndex(0);\n setPlayerKey((prev) => prev + 1);\n }\n props.onEnded?.(event);\n }}\n >\n <PlaylistEndScreen\n video={currentIndex < videoList.length - 1 ? videoList[currentIndex + 1] : videoList[0]}\n relatedVideos={videoList}\n isVisible={isEndScreenVisible}\n selectVideoCallback={selectVideo}\n timerCallback={playVideo}\n />\n </MuxPlayer>\n );\n};\n\nexport default MuxNewsPlayer;\n", "import React, { useEffect, useState } from 'react';\nimport { VideoItem, PlaylistVideos } from '.';\nimport style from './playlist-end-screen.css';\n\ninterface PlaylistEndScreenProps {\n video: VideoItem;\n relatedVideos: PlaylistVideos;\n isVisible: boolean;\n selectVideoCallback: (index: number) => void;\n timerCallback: () => void;\n}\n\nconst PlaylistEndScreen = ({\n video,\n relatedVideos,\n isVisible,\n selectVideoCallback,\n timerCallback,\n}: PlaylistEndScreenProps) => {\n const [count, setCount] = useState(3);\n\n useEffect(() => {\n if (!isVisible) {\n setCount(3);\n return;\n }\n\n if (count < 0) {\n timerCallback();\n return;\n }\n const timer = setInterval(() => {\n setCount((prev) => Math.max(prev - 1, -1));\n }, 1000);\n\n return () => clearInterval(timer);\n }, [count, isVisible]);\n\n return (\n <>\n <style>{style}</style>\n <div className=\"playlist\" style={{ display: isVisible ? 'grid' : 'none' }}>\n <div className=\"overlay\" style={{ display: isVisible ? 'grid' : 'none' }} />\n <div className=\"post-video-section\" style={{ display: isVisible ? 'grid' : 'none', zIndex: 99 }}>\n <div className=\"video-section\">\n <div className=\"video-container\">\n <h2 className=\"title\">Video</h2>\n <div className=\"video-wrapper\">\n <img className=\"video-thumbnail\" src={video.imageUrl} alt={video.title} />\n <div className=\"countdown-overlay\">\n <svg className=\"countdown-ring\" width=\"50\" height=\"50\">\n <circle cx=\"25\" cy=\"25\" r=\"22\" className=\"circle-background\" />\n <circle\n cx=\"25\"\n cy=\"25\"\n r=\"22\"\n className=\"circle-progress\"\n style={{\n strokeDasharray: '138',\n strokeDashoffset: `${(count / 3) * 138}`,\n }}\n />\n </svg>\n <span className=\"count-text\">{count}</span>\n </div>\n </div>\n <p className=\"video-title\">{video.title}</p>\n </div>\n </div>\n <hr />\n <div className=\"related-videos-section\">\n <h3 className=\"related-title\">Related Videos</h3>\n <ul className=\"related-list\">\n {relatedVideos.map((relatedVideo, index) => (\n <li key={index}>\n <button className=\"related-item\" onClick={() => selectVideoCallback(index)}>\n <img className=\"related-thumbnail\" src={relatedVideo.imageUrl} alt={relatedVideo.title} />\n <p className=\"related-text\">{relatedVideo.title}</p>\n </button>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </>\n );\n};\n\nexport default PlaylistEndScreen;\n", "/* Main Playlist Container */\n.playlist {\n /* Ensure it wraps on smaller screens */\n display: inline;\n position: relative;\n background-color: #12121263;\n z-index: 2;\n top: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n@media (min-width: 1336px) {\n .playlist {\n align-items: center;\n justify-content: center;\n }\n}\n\n.overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n background: black;\n opacity: 0.5;\n z-index: 1;\n}\n\n.post-video-section {\n display: grid;\n grid-template-columns: 1fr auto 1fr;\n padding: 1.5rem 2rem;\n position: relative;\n gap: 1rem;\n padding: 1.5rem 2rem;\n height: max-content;\n box-sizing: border-box;\n z-index: 2;\n max-width: 1200px;\n}\n\n.post-video-section hr {\n border: none;\n background: rgba(255, 255, 255, 0.5);\n height: 100%;\n width: 1px;\n}\n\n/* Video Section */\n.video-section {\n flex: 2;\n}\n\n.video-container {\n position: relative;\n}\n\n.title {\n font-size: 2.5rem;\n font-weight: 500;\n line-height: 3rem;\n margin: 0;\n margin-bottom: 1rem;\n}\n\n.video-wrapper {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n.video-container > .video-title {\n font-size: 1.3rem;\n font-weight: 600;\n}\n\n.video-thumbnail {\n width: 100%;\n display: block;\n}\n\n.video-title {\n font-size: 1rem;\n margin-top: 0.5rem;\n cursor: pointer;\n color: #ffffff;\n text-decoration: none;\n line-height: 1.4;\n /* Adjusted for better readability */\n word-wrap: break-word;\n font-weight: 500;\n margin-bottom: 0;\n}\n\n.video-title:hover {\n text-decoration: underline;\n}\n\n/* Countdown Timer */\n.countdown-overlay {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 3.75rem;\n height: 3.75rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.countdown-ring {\n position: absolute;\n}\n\n.circle-background {\n fill: none;\n stroke: rgba(255, 255, 255, 0.2);\n stroke-width: 0.25rem;\n}\n\n.circle-progress {\n fill: none;\n stroke: #00a3dd;\n stroke-width: 0.25rem;\n stroke-linecap: round;\n transition: stroke-dashoffset 1s linear;\n}\n\n.count-text {\n position: absolute;\n font-size: 1rem;\n font-weight: bold;\n color: #ffffff;\n}\n\n/* Related Videos */\n.related-videos-section {\n flex: 1;\n width: 100%;\n}\n\n.related-title {\n font-size: 1.125rem;\n font-weight: bold;\n margin: 0;\n line-height: 2rem;\n}\n\n.related-list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n.related-item {\n display: flex;\n align-items: start;\n border-bottom: 1px solid rgba(255, 255, 255, 0.5);\n width: 100%;\n gap: 0.5rem;\n padding: 0.5rem 0;\n border-radius: 0;\n background: none;\n}\n\n.related-item:hover {\n background: none;\n}\n.related-thumbnail {\n width: 7rem;\n object-fit: cover;\n aspect-ratio: 16 / 9;\n}\n\n.related-text {\n font-size: 0.9rem;\n color: white;\n line-height: 1.4;\n word-wrap: break-word;\n max-width: 100%;\n margin-top: 0.25rem;\n display: block;\n}\n\n.related-text:hover {\n text-decoration: underline;\n}\n\n/* Responsive */\n\n@media (max-width: 768px) {\n .post-video-section {\n grid-template-columns: 1fr;\n margin: auto;\n }\n\n .post-video-section h2 {\n display: none;\n }\n\n hr {\n display: none;\n }\n\n .video-section {\n width: 60%;\n margin: auto;\n }\n\n .related-videos-section {\n display: none;\n }\n}\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAwC,oBACxCC,EAA0C,wCAC1CC,EAAsB,gDCFtB,IAAAC,EAA2C,oBCA3C,IAAAC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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CAAC,EAAIH,EAAU,CAAC,EACtF,cAAeA,EACf,UAAWK,EACX,oBAAqBK,EACrB,cAAeD,EACjB,CACF,CAEJ,EAEOU,EAAQpB",
|
|
6
|
+
"names": ["index_exports", "__export", "index_default", "__toCommonJS", "import_react", "import_ads", "import_news", "import_react", "playlist_end_screen_default", "PlaylistEndScreen", "video", "relatedVideos", "isVisible", "selectVideoCallback", "timerCallback", "count", "setCount", "timer", "prev", "React", "playlist_end_screen_default", "relatedVideo", "index", "MuxNewsPlayer", "videoList", "props", "mediaElRef", "currentIndex", "setCurrentIndex", "isEndScreenVisible", "setIsEndScreenVisible", "playerKey", "setPlayerKey", "playVideo", "selectVideo", "index", "React", "MuxPlayer", "NewsTheme", "event", "_a", "prev", "playlist_end_screen_default", "index_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import y,{useRef as P,useState as c}from"react";import N from"@mux/mux-player-react/ads";import V from"@mux/mux-player-react/themes/news";import e,{useEffect as x,useState as w}from"react";var u=`/* Main Playlist Container */
|
|
2
|
+
.playlist {
|
|
3
|
+
/* Ensure it wraps on smaller screens */
|
|
4
|
+
display: inline;
|
|
5
|
+
position: relative;
|
|
6
|
+
background-color: #12121263;
|
|
7
|
+
z-index: 2;
|
|
8
|
+
top: 0;
|
|
9
|
+
position: absolute;
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (min-width: 1336px) {
|
|
15
|
+
.playlist {
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.overlay {
|
|
22
|
+
position: absolute;
|
|
23
|
+
width: 100%;
|
|
24
|
+
height: 100%;
|
|
25
|
+
background: black;
|
|
26
|
+
opacity: 0.5;
|
|
27
|
+
z-index: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.post-video-section {
|
|
31
|
+
display: grid;
|
|
32
|
+
grid-template-columns: 1fr auto 1fr;
|
|
33
|
+
padding: 1.5rem 2rem;
|
|
34
|
+
position: relative;
|
|
35
|
+
gap: 1rem;
|
|
36
|
+
padding: 1.5rem 2rem;
|
|
37
|
+
height: max-content;
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
z-index: 2;
|
|
40
|
+
max-width: 1200px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.post-video-section hr {
|
|
44
|
+
border: none;
|
|
45
|
+
background: rgba(255, 255, 255, 0.5);
|
|
46
|
+
height: 100%;
|
|
47
|
+
width: 1px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Video Section */
|
|
51
|
+
.video-section {
|
|
52
|
+
flex: 2;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.video-container {
|
|
56
|
+
position: relative;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.title {
|
|
60
|
+
font-size: 2.5rem;
|
|
61
|
+
font-weight: 500;
|
|
62
|
+
line-height: 3rem;
|
|
63
|
+
margin: 0;
|
|
64
|
+
margin-bottom: 1rem;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.video-wrapper {
|
|
68
|
+
position: relative;
|
|
69
|
+
width: 100%;
|
|
70
|
+
overflow: hidden;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.video-container > .video-title {
|
|
74
|
+
font-size: 1.3rem;
|
|
75
|
+
font-weight: 600;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.video-thumbnail {
|
|
79
|
+
width: 100%;
|
|
80
|
+
display: block;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.video-title {
|
|
84
|
+
font-size: 1rem;
|
|
85
|
+
margin-top: 0.5rem;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
color: #ffffff;
|
|
88
|
+
text-decoration: none;
|
|
89
|
+
line-height: 1.4;
|
|
90
|
+
/* Adjusted for better readability */
|
|
91
|
+
word-wrap: break-word;
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
margin-bottom: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.video-title:hover {
|
|
97
|
+
text-decoration: underline;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* Countdown Timer */
|
|
101
|
+
.countdown-overlay {
|
|
102
|
+
position: absolute;
|
|
103
|
+
top: 50%;
|
|
104
|
+
left: 50%;
|
|
105
|
+
transform: translate(-50%, -50%);
|
|
106
|
+
width: 3.75rem;
|
|
107
|
+
height: 3.75rem;
|
|
108
|
+
display: flex;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
align-items: center;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.countdown-ring {
|
|
114
|
+
position: absolute;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.circle-background {
|
|
118
|
+
fill: none;
|
|
119
|
+
stroke: rgba(255, 255, 255, 0.2);
|
|
120
|
+
stroke-width: 0.25rem;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.circle-progress {
|
|
124
|
+
fill: none;
|
|
125
|
+
stroke: #00a3dd;
|
|
126
|
+
stroke-width: 0.25rem;
|
|
127
|
+
stroke-linecap: round;
|
|
128
|
+
transition: stroke-dashoffset 1s linear;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.count-text {
|
|
132
|
+
position: absolute;
|
|
133
|
+
font-size: 1rem;
|
|
134
|
+
font-weight: bold;
|
|
135
|
+
color: #ffffff;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/* Related Videos */
|
|
139
|
+
.related-videos-section {
|
|
140
|
+
flex: 1;
|
|
141
|
+
width: 100%;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.related-title {
|
|
145
|
+
font-size: 1.125rem;
|
|
146
|
+
font-weight: bold;
|
|
147
|
+
margin: 0;
|
|
148
|
+
line-height: 2rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.related-list {
|
|
152
|
+
list-style: none;
|
|
153
|
+
padding: 0;
|
|
154
|
+
margin: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.related-item {
|
|
158
|
+
display: flex;
|
|
159
|
+
align-items: start;
|
|
160
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.5);
|
|
161
|
+
width: 100%;
|
|
162
|
+
gap: 0.5rem;
|
|
163
|
+
padding: 0.5rem 0;
|
|
164
|
+
border-radius: 0;
|
|
165
|
+
background: none;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.related-item:hover {
|
|
169
|
+
background: none;
|
|
170
|
+
}
|
|
171
|
+
.related-thumbnail {
|
|
172
|
+
width: 7rem;
|
|
173
|
+
object-fit: cover;
|
|
174
|
+
aspect-ratio: 16 / 9;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.related-text {
|
|
178
|
+
font-size: 0.9rem;
|
|
179
|
+
color: white;
|
|
180
|
+
line-height: 1.4;
|
|
181
|
+
word-wrap: break-word;
|
|
182
|
+
max-width: 100%;
|
|
183
|
+
margin-top: 0.25rem;
|
|
184
|
+
display: block;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.related-text:hover {
|
|
188
|
+
text-decoration: underline;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/* Responsive */
|
|
192
|
+
|
|
193
|
+
@media (max-width: 768px) {
|
|
194
|
+
.post-video-section {
|
|
195
|
+
grid-template-columns: 1fr;
|
|
196
|
+
margin: auto;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.post-video-section h2 {
|
|
200
|
+
display: none;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
hr {
|
|
204
|
+
display: none;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.video-section {
|
|
208
|
+
width: 60%;
|
|
209
|
+
margin: auto;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.related-videos-section {
|
|
213
|
+
display: none;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
`;var k=({video:t,relatedVideos:l,isVisible:i,selectVideoCallback:o,timerCallback:d})=>{let[a,n]=w(3);return x(()=>{if(!i){n(3);return}if(a<0){d();return}let r=setInterval(()=>{n(s=>Math.max(s-1,-1))},1e3);return()=>clearInterval(r)},[a,i]),e.createElement(e.Fragment,null,e.createElement("style",null,u),e.createElement("div",{className:"playlist",style:{display:i?"grid":"none"}},e.createElement("div",{className:"overlay",style:{display:i?"grid":"none"}}),e.createElement("div",{className:"post-video-section",style:{display:i?"grid":"none",zIndex:99}},e.createElement("div",{className:"video-section"},e.createElement("div",{className:"video-container"},e.createElement("h2",{className:"title"},"Video"),e.createElement("div",{className:"video-wrapper"},e.createElement("img",{className:"video-thumbnail",src:t.imageUrl,alt:t.title}),e.createElement("div",{className:"countdown-overlay"},e.createElement("svg",{className:"countdown-ring",width:"50",height:"50"},e.createElement("circle",{cx:"25",cy:"25",r:"22",className:"circle-background"}),e.createElement("circle",{cx:"25",cy:"25",r:"22",className:"circle-progress",style:{strokeDasharray:"138",strokeDashoffset:`${a/3*138}`}})),e.createElement("span",{className:"count-text"},a))),e.createElement("p",{className:"video-title"},t.title))),e.createElement("hr",null),e.createElement("div",{className:"related-videos-section"},e.createElement("h3",{className:"related-title"},"Related Videos"),e.createElement("ul",{className:"related-list"},l.map((r,s)=>e.createElement("li",{key:s},e.createElement("button",{className:"related-item",onClick:()=>o(s)},e.createElement("img",{className:"related-thumbnail",src:r.imageUrl,alt:r.title}),e.createElement("p",{className:"related-text"},r.title)))))))))},g=k;var I=({videoList:t,...l})=>{let i=P(null),[o,d]=c(0),[a,n]=c(!1),[r,s]=c(0);function f(){n(!1),d(o+1),setTimeout(()=>{try{i.current.play()}catch{}},200)}function h(m){n(!1),d(m),setTimeout(()=>{try{i.current.play()}catch{}},200)}return y.createElement(N,{theme:V,style:{aspectRatio:"16/9"},preferPlayback:"mse",maxResolution:"2160p",minResolution:"540p",renditionOrder:"desc",metadata:{video_title:t[o].title},...l,ref:i,key:`player-${r}`,playbackId:t[o].playbackId,adTagUrl:t[o].adTagUrl,onEnded:m=>{var p;o<t.length-1?n(!0):(d(0),s(b=>b+1)),(p=l.onEnded)==null||p.call(l,m)}},y.createElement(g,{video:o<t.length-1?t[o+1]:t[0],relatedVideos:t,isVisible:a,selectVideoCallback:h,timerCallback:f}))},K=I;export{K as default};
|
|
217
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/news/index.tsx", "../../src/news/playlist-end-screen.tsx", "../../src/news/playlist-end-screen.css"],
|
|
4
|
+
"sourcesContent": ["import React, { useRef, useState } from 'react';\nimport MuxPlayer, { MuxPlayerProps } from '@mux/mux-player-react/ads';\nimport NewsTheme from '@mux/mux-player-react/themes/news';\nimport PlaylistEndScreen from './playlist-end-screen';\n\nexport interface VideoItem {\n imageUrl: string;\n title: string;\n playbackId: string;\n adTagUrl: string;\n}\n\nexport type PlaylistVideos = VideoItem[];\n\nexport interface PlaylistProps extends Omit<MuxPlayerProps, 'playbackId' | 'adTagUrl'> {\n videoList: PlaylistVideos;\n}\n\nconst MuxNewsPlayer = ({ videoList, ...props }: PlaylistProps) => {\n const mediaElRef = useRef<any>(null);\n const [currentIndex, setCurrentIndex] = useState(0);\n const [isEndScreenVisible, setIsEndScreenVisible] = useState(false);\n const [playerKey, setPlayerKey] = useState(0);\n\n function playVideo() {\n setIsEndScreenVisible(false);\n setCurrentIndex(currentIndex + 1);\n setTimeout(() => {\n try {\n mediaElRef.current.play();\n } catch {\n // Ignore AbortError: The play() request was interrupted by a call to pause()\n }\n }, 200);\n }\n\n function selectVideo(index: number) {\n setIsEndScreenVisible(false);\n setCurrentIndex(index);\n setTimeout(() => {\n try {\n mediaElRef.current.play();\n } catch {\n // Ignore AbortError: The play() request was interrupted by a call to pause()\n }\n }, 200);\n }\n\n return (\n <MuxPlayer\n theme={NewsTheme}\n style={{ aspectRatio: '16/9' }}\n preferPlayback=\"mse\"\n maxResolution=\"2160p\"\n minResolution=\"540p\"\n renditionOrder=\"desc\"\n metadata={{\n video_title: videoList[currentIndex].title,\n }}\n {...props}\n ref={mediaElRef}\n key={`player-${playerKey}`}\n playbackId={videoList[currentIndex].playbackId}\n adTagUrl={videoList[currentIndex].adTagUrl}\n onEnded={(event) => {\n if (currentIndex < videoList.length - 1) {\n setIsEndScreenVisible(true);\n } else {\n setCurrentIndex(0);\n setPlayerKey((prev) => prev + 1);\n }\n props.onEnded?.(event);\n }}\n >\n <PlaylistEndScreen\n video={currentIndex < videoList.length - 1 ? videoList[currentIndex + 1] : videoList[0]}\n relatedVideos={videoList}\n isVisible={isEndScreenVisible}\n selectVideoCallback={selectVideo}\n timerCallback={playVideo}\n />\n </MuxPlayer>\n );\n};\n\nexport default MuxNewsPlayer;\n", "import React, { useEffect, useState } from 'react';\nimport { VideoItem, PlaylistVideos } from '.';\nimport style from './playlist-end-screen.css';\n\ninterface PlaylistEndScreenProps {\n video: VideoItem;\n relatedVideos: PlaylistVideos;\n isVisible: boolean;\n selectVideoCallback: (index: number) => void;\n timerCallback: () => void;\n}\n\nconst PlaylistEndScreen = ({\n video,\n relatedVideos,\n isVisible,\n selectVideoCallback,\n timerCallback,\n}: PlaylistEndScreenProps) => {\n const [count, setCount] = useState(3);\n\n useEffect(() => {\n if (!isVisible) {\n setCount(3);\n return;\n }\n\n if (count < 0) {\n timerCallback();\n return;\n }\n const timer = setInterval(() => {\n setCount((prev) => Math.max(prev - 1, -1));\n }, 1000);\n\n return () => clearInterval(timer);\n }, [count, isVisible]);\n\n return (\n <>\n <style>{style}</style>\n <div className=\"playlist\" style={{ display: isVisible ? 'grid' : 'none' }}>\n <div className=\"overlay\" style={{ display: isVisible ? 'grid' : 'none' }} />\n <div className=\"post-video-section\" style={{ display: isVisible ? 'grid' : 'none', zIndex: 99 }}>\n <div className=\"video-section\">\n <div className=\"video-container\">\n <h2 className=\"title\">Video</h2>\n <div className=\"video-wrapper\">\n <img className=\"video-thumbnail\" src={video.imageUrl} alt={video.title} />\n <div className=\"countdown-overlay\">\n <svg className=\"countdown-ring\" width=\"50\" height=\"50\">\n <circle cx=\"25\" cy=\"25\" r=\"22\" className=\"circle-background\" />\n <circle\n cx=\"25\"\n cy=\"25\"\n r=\"22\"\n className=\"circle-progress\"\n style={{\n strokeDasharray: '138',\n strokeDashoffset: `${(count / 3) * 138}`,\n }}\n />\n </svg>\n <span className=\"count-text\">{count}</span>\n </div>\n </div>\n <p className=\"video-title\">{video.title}</p>\n </div>\n </div>\n <hr />\n <div className=\"related-videos-section\">\n <h3 className=\"related-title\">Related Videos</h3>\n <ul className=\"related-list\">\n {relatedVideos.map((relatedVideo, index) => (\n <li key={index}>\n <button className=\"related-item\" onClick={() => selectVideoCallback(index)}>\n <img className=\"related-thumbnail\" src={relatedVideo.imageUrl} alt={relatedVideo.title} />\n <p className=\"related-text\">{relatedVideo.title}</p>\n </button>\n </li>\n ))}\n </ul>\n </div>\n </div>\n </div>\n </>\n );\n};\n\nexport default PlaylistEndScreen;\n", "/* Main Playlist Container */\n.playlist {\n /* Ensure it wraps on smaller screens */\n display: inline;\n position: relative;\n background-color: #12121263;\n z-index: 2;\n top: 0;\n position: absolute;\n width: 100%;\n height: 100%;\n}\n\n@media (min-width: 1336px) {\n .playlist {\n align-items: center;\n justify-content: center;\n }\n}\n\n.overlay {\n position: absolute;\n width: 100%;\n height: 100%;\n background: black;\n opacity: 0.5;\n z-index: 1;\n}\n\n.post-video-section {\n display: grid;\n grid-template-columns: 1fr auto 1fr;\n padding: 1.5rem 2rem;\n position: relative;\n gap: 1rem;\n padding: 1.5rem 2rem;\n height: max-content;\n box-sizing: border-box;\n z-index: 2;\n max-width: 1200px;\n}\n\n.post-video-section hr {\n border: none;\n background: rgba(255, 255, 255, 0.5);\n height: 100%;\n width: 1px;\n}\n\n/* Video Section */\n.video-section {\n flex: 2;\n}\n\n.video-container {\n position: relative;\n}\n\n.title {\n font-size: 2.5rem;\n font-weight: 500;\n line-height: 3rem;\n margin: 0;\n margin-bottom: 1rem;\n}\n\n.video-wrapper {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n.video-container > .video-title {\n font-size: 1.3rem;\n font-weight: 600;\n}\n\n.video-thumbnail {\n width: 100%;\n display: block;\n}\n\n.video-title {\n font-size: 1rem;\n margin-top: 0.5rem;\n cursor: pointer;\n color: #ffffff;\n text-decoration: none;\n line-height: 1.4;\n /* Adjusted for better readability */\n word-wrap: break-word;\n font-weight: 500;\n margin-bottom: 0;\n}\n\n.video-title:hover {\n text-decoration: underline;\n}\n\n/* Countdown Timer */\n.countdown-overlay {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 3.75rem;\n height: 3.75rem;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.countdown-ring {\n position: absolute;\n}\n\n.circle-background {\n fill: none;\n stroke: rgba(255, 255, 255, 0.2);\n stroke-width: 0.25rem;\n}\n\n.circle-progress {\n fill: none;\n stroke: #00a3dd;\n stroke-width: 0.25rem;\n stroke-linecap: round;\n transition: stroke-dashoffset 1s linear;\n}\n\n.count-text {\n position: absolute;\n font-size: 1rem;\n font-weight: bold;\n color: #ffffff;\n}\n\n/* Related Videos */\n.related-videos-section {\n flex: 1;\n width: 100%;\n}\n\n.related-title {\n font-size: 1.125rem;\n font-weight: bold;\n margin: 0;\n line-height: 2rem;\n}\n\n.related-list {\n list-style: none;\n padding: 0;\n margin: 0;\n}\n\n.related-item {\n display: flex;\n align-items: start;\n border-bottom: 1px solid rgba(255, 255, 255, 0.5);\n width: 100%;\n gap: 0.5rem;\n padding: 0.5rem 0;\n border-radius: 0;\n background: none;\n}\n\n.related-item:hover {\n background: none;\n}\n.related-thumbnail {\n width: 7rem;\n object-fit: cover;\n aspect-ratio: 16 / 9;\n}\n\n.related-text {\n font-size: 0.9rem;\n color: white;\n line-height: 1.4;\n word-wrap: break-word;\n max-width: 100%;\n margin-top: 0.25rem;\n display: block;\n}\n\n.related-text:hover {\n text-decoration: underline;\n}\n\n/* Responsive */\n\n@media (max-width: 768px) {\n .post-video-section {\n grid-template-columns: 1fr;\n margin: auto;\n }\n\n .post-video-section h2 {\n display: none;\n }\n\n hr {\n display: none;\n }\n\n .video-section {\n width: 60%;\n margin: auto;\n }\n\n .related-videos-section {\n display: none;\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,GAAS,UAAAC,EAAQ,YAAAC,MAAgB,QACxC,OAAOC,MAAmC,4BAC1C,OAAOC,MAAe,oCCFtB,OAAOC,GAAS,aAAAC,EAAW,YAAAC,MAAgB,QCA3C,IAAAC,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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IC,EAAS,CAAC,EAC5C,CAACC,EAAoBC,CAAqB,EAAIF,EAAS,EAAK,EAC5D,CAACG,EAAWC,CAAY,EAAIJ,EAAS,CAAC,EAE5C,SAASK,GAAY,CACnBH,EAAsB,EAAK,EAC3BH,EAAgBD,EAAe,CAAC,EAChC,WAAW,IAAM,CACf,GAAI,CACFF,EAAW,QAAQ,KAAK,CAC1B,MAAQ,CAER,CACF,EAAG,GAAG,CACR,CAEA,SAASU,EAAYC,EAAe,CAClCL,EAAsB,EAAK,EAC3BH,EAAgBQ,CAAK,EACrB,WAAW,IAAM,CACf,GAAI,CACFX,EAAW,QAAQ,KAAK,CAC1B,MAAQ,CAER,CACF,EAAG,GAAG,CACR,CAEA,OACEY,EAAA,cAACC,EAAA,CACC,MAAOC,EACP,MAAO,CAAE,YAAa,MAAO,EAC7B,eAAe,MACf,cAAc,QACd,cAAc,OACd,eAAe,OACf,SAAU,CACR,YAAahB,EAAUI,CAAY,EAAE,KACvC,EACC,GAAGH,EACJ,IAAKC,EACL,IAAK,UAAUO,CAAS,GACxB,WAAYT,EAAUI,CAAY,EAAE,WACpC,SAAUJ,EAAUI,CAAY,EAAE,SAClC,QAAUa,GAAU,CAhE1B,IAAAC,EAiEYd,EAAeJ,EAAU,OAAS,EACpCQ,EAAsB,EAAI,GAE1BH,EAAgB,CAAC,EACjBK,EAAcS,GAASA,EAAO,CAAC,IAEjCD,EAAAjB,EAAM,UAAN,MAAAiB,EAAA,KAAAjB,EAAgBgB,EAClB,GAEAH,EAAA,cAACM,EAAA,CACC,MAAOhB,EAAeJ,EAAU,OAAS,EAAIA,EAAUI,EAAe,CAAC,EAAIJ,EAAU,CAAC,EACtF,cAAeA,EACf,UAAWO,EACX,oBAAqBK,EACrB,cAAeD,EACjB,CACF,CAEJ,EAEOU,EAAQtB",
|
|
6
|
+
"names": ["React", "useRef", "useState", "MuxPlayer", "NewsTheme", "React", "useEffect", "useState", "playlist_end_screen_default", "PlaylistEndScreen", "video", "relatedVideos", "isVisible", "selectVideoCallback", "timerCallback", "count", "setCount", "useState", "useEffect", "timer", "prev", "React", "playlist_end_screen_default", "relatedVideo", "index", "MuxNewsPlayer", "videoList", "props", "mediaElRef", "useRef", "currentIndex", "setCurrentIndex", "useState", "isEndScreenVisible", "setIsEndScreenVisible", "playerKey", "setPlayerKey", "playVideo", "selectVideo", "index", "React", "MuxPlayer", "NewsTheme", "event", "_a", "prev", "playlist_end_screen_default", "index_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";"use client";var n=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var s=Object.prototype.hasOwnProperty;var u=(t,e)=>{for(var l in e)n(t,l,{get:e[l],enumerable:!0})},a=(t,e,l,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of r(e))!s.call(t,i)&&i!==l&&n(t,i,{get:()=>e[i],enumerable:!(o=p(e,i))||o.enumerable});return t};var c=t=>a(n({},"__esModule",{value:!0}),t);var f={};u(f,{default:()=>d});module.exports=c(f);var w=require("@mux/mux-player/themes/news"),d="news";
|
|
2
|
+
//# sourceMappingURL=news.cjs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/themes/news.ts"],
|
|
4
|
+
"sourcesContent": ["'use client';\nimport '@mux/mux-player/themes/news';\nexport default 'news';\n"],
|
|
5
|
+
"mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GACA,IAAAI,EAAO,uCACAF,EAAQ",
|
|
6
|
+
"names": ["news_exports", "__export", "news_default", "__toCommonJS", "import_news"]
|
|
7
|
+
}
|