Custom video player

This commit is contained in:
2026-07-26 22:26:37 +02:00
parent 7553b9f895
commit 2e3918def4
13 changed files with 3547 additions and 905 deletions
+796
View File
@@ -0,0 +1,796 @@
/* ============================================================
HStream Custom Video Player
Dark-theme-first with rose-red accents (#c61e54)
============================================================ */
/* ---- Player Wrapper ---- */
.hstream-player {
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
background: #000;
border-radius: 12px;
overflow: visible;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
font-family: 'Figtree', sans-serif;
direction: ltr;
isolation: isolate;
}
.hstream-player * {
box-sizing: border-box;
}
/* ---- Video Element ---- */
.hstream-player__video {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
display: block;
background: #000;
border-radius: 12px;
overflow: hidden;
touch-action: manipulation;
}
/* ---- Poster Overlay ---- */
.hstream-player__poster {
position: absolute;
inset: 0;
z-index: 1;
background: #000;
border-radius: 12px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.hstream-player__poster img {
width: 100%;
height: 100%;
object-fit: cover;
opacity: 1;
transition: opacity 0.3s ease;
}
.hstream-player__poster--hidden {
pointer-events: none;
opacity: 0;
visibility: hidden;
}
/* ---- Large Play Overlay ---- */
.hstream-player__play-overlay {
position: absolute;
inset: 0;
z-index: 2;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.hstream-player__play-overlay--visible {
opacity: 1;
}
.hstream-player__play-btn {
width: 72px;
height: 72px;
border-radius: 50%;
background: rgba(198, 30, 84, 0.85);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
border: 2px solid rgba(255, 255, 255, 0.15);
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-size: 28px;
cursor: pointer;
pointer-events: auto;
transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
box-shadow: 0 0 30px rgba(198, 30, 84, 0.4), 0 4px 20px rgba(0, 0, 0, 0.5);
}
.hstream-player__play-btn:hover {
transform: scale(1.1);
background: rgba(225, 29, 72, 0.9);
box-shadow: 0 0 40px rgba(198, 30, 84, 0.6), 0 4px 25px rgba(0, 0, 0, 0.5);
}
.hstream-player__play-btn:active {
transform: scale(0.95);
}
/* ---- Controls Container ---- */
.hstream-player__controls {
position: absolute;
bottom: 0;
left: 0;
right: 0;
z-index: 10;
background: linear-gradient(to top, rgba(10, 10, 10, 0.92), rgba(10, 10, 10, 0.75) 60%, transparent);
padding: 40px 12px 10px 12px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
transition: opacity 0.15s ease, transform 0.12s ease;
border-radius: 0 0 12px 12px;
}
.hstream-player__controls--hidden {
opacity: 0;
transform: translateY(8px);
pointer-events: none;
}
/* ---- Progress Section (full width row) ---- */
.hstream-player__progress-wrapper {
width: 100%;
padding: 6px 0;
cursor: pointer;
position: relative;
}
.hstream-player__progress {
position: relative;
height: 6px;
width: 100%;
border-radius: 3px;
background: rgba(255, 255, 255, 0.12);
transition: height 0.15s ease, margin-top 0.15s ease;
overflow: visible;
}
.hstream-player__progress:hover,
.hstream-player__progress--dragging {
height: 8px;
border-radius: 4px;
}
.hstream-player__progress--dragging .hstream-player__progress-thumb {
transform: translate(-50%, -50%) scale(1.2);
}
.hstream-player__progress-buffer {
position: absolute;
left: 0;
top: 0;
height: 100%;
border-radius: inherit;
background: rgba(255, 255, 255, 0.18);
transition: width 0.2s ease;
pointer-events: none;
z-index: 1;
}
.hstream-player__progress-fill {
position: absolute;
left: 0;
top: 0;
height: 100%;
border-radius: inherit;
background: linear-gradient(to right, #c61e54, #e11d48);
transition: width 0.1s linear;
pointer-events: none;
z-index: 2;
}
.hstream-player__progress-heatmap {
position: absolute;
left: 0;
right: 0;
bottom: 100%;
height: 48px;
pointer-events: none;
z-index: 0;
}
.hstream-player__progress-heatmap-canvas {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
}
.hstream-player__progress-thumb {
position: absolute;
top: 50%;
width: 14px;
height: 14px;
border-radius: 50%;
background: #fff;
border: 2px solid #c61e54;
transform: translate(-50%, -50%) scale(0);
transition: transform 0.15s ease;
z-index: 4;
pointer-events: none;
box-shadow: 0 0 8px rgba(198, 30, 84, 0.5);
}
.hstream-player__progress:hover .hstream-player__progress-thumb,
.hstream-player__progress-wrapper--active .hstream-player__progress-thumb {
transform: translate(-50%, -50%) scale(1);
}
/* ---- Time Tooltip ---- */
.hstream-player__time-tooltip {
position: absolute;
bottom: calc(100% + 8px);
transform: translateX(-50%);
background: rgba(10, 10, 10, 0.9);
color: #fff;
padding: 3px 8px;
border-radius: 4px;
font-size: 12px;
font-weight: 600;
white-space: nowrap;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
z-index: 5;
border: 1px solid rgba(255, 255, 255, 0.1);
}
.hstream-player__time-tooltip--visible {
opacity: 1;
}
/* ---- Thumbnail Preview ---- */
.hstream-player__thumbnail-preview {
position: absolute;
bottom: calc(100% + 16px);
transform: translateX(-50%);
background: #0a0a0a;
border: 1px solid rgba(255, 255, 255, 0.12);
border-radius: 8px;
overflow: hidden;
pointer-events: none;
opacity: 0;
transition: opacity 0.15s ease;
z-index: 5;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
}
.hstream-player__thumbnail-preview--visible {
opacity: 1;
}
.hstream-player__thumbnail-preview-img {
display: block;
object-fit: cover;
object-position: center;
}
.hstream-player__thumbnail-preview-time {
position: absolute;
bottom: 0;
left: 0;
right: 0;
padding: 2px 6px;
background: rgba(0, 0, 0, 0.7);
color: #fff;
font-size: 10px;
text-align: center;
font-weight: 600;
}
/* ---- Buttons ---- */
.hstream-player__button {
display: inline-flex;
align-items: center;
justify-content: center;
background: transparent;
border: 0;
color: #fff;
font-size: 18px;
width: 36px;
height: 36px;
border-radius: 6px;
cursor: pointer;
padding: 0;
transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
flex-shrink: 0;
}
.hstream-player__button:hover {
background: rgba(255, 255, 255, 0.08);
}
.hstream-player__button:active {
transform: scale(0.9);
}
.hstream-player__button--active {
color: #c61e54;
}
.hstream-player__button svg {
width: 20px;
height: 20px;
fill: currentColor;
}
/* ---- Time Display ---- */
.hstream-player__time-display {
color: rgba(255, 255, 255, 0.85);
font-size: 13px;
font-weight: 600;
font-variant-numeric: tabular-nums;
white-space: nowrap;
flex-shrink: 0;
padding: 0 2px;
}
.hstream-player__time-separator {
opacity: 0.5;
margin: 0 1px;
}
/* ---- Volume Wrapper ---- */
.hstream-player__volume-wrapper {
display: inline-flex;
align-items: center;
gap: 2px;
flex-shrink: 0;
height: 36px;
}
.hstream-player__volume-slider-container {
width: 0;
overflow: hidden;
transition: width 0.2s ease;
display: flex;
align-items: center;
padding: 6px 0;
margin: -6px 0;
}
.hstream-player__volume-wrapper:hover .hstream-player__volume-slider-container {
width: 60px;
}
.hstream-player--mobile .hstream-player__volume-slider-container {
width: 80px;
overflow: visible;
}
.hstream-player__volume-slider {
-webkit-appearance: none !important;
appearance: none !important;
accent-color: #c61e54 !important;
width: 56px !important;
height: 4px !important;
border-radius: 2px !important;
outline: none !important;
cursor: pointer !important;
margin: 0 !important;
padding: 0 !important;
vertical-align: middle !important;
background: transparent !important;
border: none !important;
}
.hstream-player__volume-slider:focus {
outline: none !important;
}
.hstream-player__volume-slider::-webkit-slider-runnable-track {
height: 4px !important;
border-radius: 2px !important;
background: linear-gradient(
to right,
#c61e54 0%,
#c61e54 var(--volume-pct, 50%),
rgba(255, 255, 255, 0.15) var(--volume-pct, 50%),
rgba(255, 255, 255, 0.15) 100%
) !important;
}
.hstream-player__volume-slider::-webkit-slider-thumb {
-webkit-appearance: none !important;
appearance: none !important;
width: 13px !important;
height: 13px !important;
border-radius: 50% !important;
background: #c61e54 !important;
margin-top: -5px !important;
cursor: pointer !important;
}
.hstream-player__volume-slider::-moz-range-track {
height: 4px !important;
border-radius: 2px !important;
background: rgba(255, 255, 255, 0.15) !important;
border: none !important;
}
.hstream-player__volume-slider::-moz-range-progress {
height: 4px !important;
border-radius: 2px !important;
background: #c61e54 !important;
border: none !important;
}
.hstream-player__volume-slider::-moz-range-thumb {
width: 13px !important;
height: 13px !important;
border-radius: 50% !important;
background: #c61e54 !important;
cursor: pointer !important;
}
/* ---- Spacer ---- */
.hstream-player__spacer {
flex: 1;
min-width: 4px;
}
/* ---- Settings Menu ---- */
.hstream-player__menu-container {
position: absolute;
right: 12px;
bottom: 100%;
margin-bottom: 2px;
min-width: 220px;
max-width: 280px;
background: rgba(20, 20, 20, 0.95);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 10px;
overflow: hidden;
z-index: 20;
opacity: 0;
transform: translateY(4px);
pointer-events: none;
transition: opacity 0.15s ease, transform 0.15s ease;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.hstream-player__menu-container--open {
opacity: 1;
transform: translateY(0);
pointer-events: auto;
}
.hstream-player__menu-panel {
display: none;
}
.hstream-player__menu-panel--active {
display: block;
}
.hstream-player__menu-back {
display: flex;
align-items: center;
gap: 8px;
width: 100%;
padding: 10px 14px;
background: transparent;
border: 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
color: rgba(255, 255, 255, 0.7);
font-size: 13px;
font-weight: 600;
cursor: pointer;
font-family: inherit;
transition: background 0.15s ease;
}
.hstream-player__menu-back:hover {
background: rgba(255, 255, 255, 0.04);
color: #fff;
}
.hstream-player__menu-back i {
font-size: 10px;
}
.hstream-player__menu-item {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
padding: 10px 14px;
background: transparent;
border: 0;
color: rgba(255, 255, 255, 0.85);
font-size: 13px;
font-weight: 500;
cursor: pointer;
font-family: inherit;
transition: background 0.15s ease, color 0.15s ease;
text-align: left;
}
.hstream-player__menu-item:hover {
background: rgba(255, 255, 255, 0.06);
color: #fff;
}
.hstream-player__menu-item--checked {
color: #c61e54;
}
.hstream-player__menu-item-radio {
width: 14px;
height: 14px;
border-radius: 50%;
border: 2px solid rgba(255, 255, 255, 0.3);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
margin-left: 8px;
}
.hstream-player__menu-item--checked .hstream-player__menu-item-radio {
border-color: #c61e54;
}
.hstream-player__menu-item--checked .hstream-player__menu-item-radio::after {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
background: #c61e54;
}
.hstream-player__menu-value {
color: rgba(255, 255, 255, 0.45);
font-size: 12px;
margin-left: auto;
white-space: nowrap;
}
.hstream-player__menu-item > span:first-of-type {
display: flex;
align-items: center;
flex: 1;
min-width: 0;
margin-right: 8px;
}
.hstream-player__menu-item--checked .hstream-player__menu-value {
color: #c61e54;
}
.hstream-player__menu-badge {
display: inline-block;
background: #c61e54;
color: #fff;
font-size: 10px;
font-weight: 700;
padding: 1px 6px;
border-radius: 4px;
text-transform: uppercase;
}
.hstream-player__menu-divider {
height: 1px;
background: rgba(255, 255, 255, 0.06);
margin: 4px 0;
}
/* ---- Skip Overlay (Mobile) ---- */
.hstream-player__skip-overlay {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
z-index: 3;
pointer-events: none;
opacity: 0;
transition: opacity 0.5s ease;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background: rgba(198, 30, 84, 0.7);
border-radius: 50%;
width: 70px;
height: 70px;
color: #fff;
font-size: 14px;
font-weight: 700;
box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}
.hstream-player__skip-overlay--visible {
opacity: 0.9;
}
.hstream-player__skip-overlay i {
font-size: 22px;
margin-bottom: 2px;
}
/* ---- Loading Spinner ---- */
.hstream-player__loading {
position: absolute;
inset: 0;
z-index: 3;
display: flex;
align-items: center;
justify-content: center;
pointer-events: none;
opacity: 0;
transition: opacity 0.3s ease;
}
.hstream-player__loading--visible {
opacity: 1;
}
.hstream-player__spinner {
width: 48px;
height: 48px;
border: 3px solid rgba(255, 255, 255, 0.15);
border-top-color: #c61e54;
border-radius: 50%;
animation: hstream-spin 0.8s linear infinite;
}
@keyframes hstream-spin {
to { transform: rotate(360deg); }
}
/* ---- Fullscreen (remove rounded borders) ---- */
.hstream-player:fullscreen,
.hstream-player:-webkit-full-screen {
border-radius: 0;
}
.hstream-player:fullscreen .hstream-player__video,
.hstream-player:-webkit-full-screen .hstream-player__video,
.hstream-player:fullscreen .hstream-player__poster,
.hstream-player:-webkit-full-screen .hstream-player__poster,
.hstream-player:fullscreen .hstream-player__controls,
.hstream-player:-webkit-full-screen .hstream-player__controls {
border-radius: 0;
}
/* ---- Idle State (hide controls & cursor) ---- */
.hstream-player--idle {
cursor: none;
}
.hstream-player--idle .hstream-player__controls {
opacity: 0;
transform: translateY(8px);
pointer-events: none;
}
/* ---- Mobile Responsive ---- */
@media (max-width: 767px) {
.hstream-player {
border-radius: 0;
}
.hstream-player__controls {
padding: 36px 4px 8px 4px;
gap: 2px;
border-radius: 0;
}
.hstream-player__button {
width: 40px;
height: 40px;
font-size: 16px;
border-radius: 8px;
}
.hstream-player__time-display {
font-size: 12px;
}
.hstream-player__play-btn {
width: 60px;
height: 60px;
font-size: 24px;
}
.hstream-player__menu-container {
right: 8px;
min-width: 200px;
max-width: 240px;
}
.hstream-player__progress-wrapper {
padding: 8px 0;
}
.hstream-player__progress {
height: 5px;
}
.hstream-player__progress-thumb {
width: 16px;
height: 16px;
}
.hstream-player__skip-overlay {
width: 60px;
height: 60px;
font-size: 12px;
}
.hstream-player__skip-overlay i {
font-size: 18px;
}
.hstream-player__thumbnail-preview {
display: none !important;
}
.hstream-player__volume-slider-container {
width: 60px;
overflow: visible;
}
.hstream-player__volume-slider {
accent-color: #c61e54 !important;
width: 56px !important;
height: 6px !important;
border-radius: 3px !important;
}
.hstream-player__volume-slider::-webkit-slider-runnable-track {
height: 6px !important;
border-radius: 3px !important;
background: linear-gradient(
to right,
#c61e54 0%,
#c61e54 var(--volume-pct, 50%),
rgba(255, 255, 255, 0.15) var(--volume-pct, 50%),
rgba(255, 255, 255, 0.15) 100%
) !important;
}
.hstream-player__volume-slider::-webkit-slider-thumb {
width: 18px !important;
height: 18px !important;
margin-top: -6px !important;
}
.hstream-player__volume-slider::-moz-range-track {
height: 6px !important;
border-radius: 3px !important;
background: rgba(255, 255, 255, 0.15) !important;
border: none !important;
}
.hstream-player__volume-slider::-moz-range-progress {
height: 6px !important;
border-radius: 3px !important;
background: #c61e54 !important;
border: none !important;
}
.hstream-player__volume-slider::-moz-range-thumb {
width: 18px !important;
height: 18px !important;
}
}
@media (max-width: 380px) {
.hstream-player__time-display {
display: none;
}
.hstream-player__button {
width: 36px;
height: 36px;
}
}