-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from THEOplayer/portrait-example
Add portrait example
- Loading branch information
Showing
6 changed files
with
131 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
body { | ||
background: #fff; | ||
} | ||
|
||
.material-symbols-rounded { | ||
font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
.phone { | ||
display: block; | ||
background: url('../assets/phone-back.png') no-repeat; | ||
background-size: contain; | ||
box-sizing: border-box; | ||
width: 50%; | ||
padding: 2.5%; | ||
aspect-ratio: 1547 / 3272; | ||
} | ||
|
||
theoplayer-ui, | ||
theoplayer-ui:not(:defined) { | ||
background: transparent; | ||
font-family: 'Noto Sans', sans-serif; | ||
width: 100%; | ||
height: 100%; | ||
padding: 0; | ||
} | ||
|
||
theoplayer-ui { | ||
--theoplayer-video-border-radius: 10px; | ||
--theoplayer-video-object-fit: cover; | ||
} | ||
|
||
.spacer { | ||
flex-grow: 1; | ||
} | ||
|
||
.top-chrome { | ||
justify-content: flex-end; | ||
} | ||
|
||
.centered-chrome * { | ||
--theoplayer-control-height: 48px; | ||
--theoplayer-text-content-height: 100%; | ||
} | ||
|
||
.centered-chrome .material-symbols-rounded { | ||
font-size: var(--theoplayer-control-height); | ||
} | ||
|
||
.side-chrome { | ||
align-self: end; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: flex-end; | ||
height: 100%; | ||
} | ||
|
||
.bottom-chrome { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
theoplayer-time-range { | ||
--theoplayer-range-padding: 5px; | ||
} | ||
|
||
/* | ||
* Hide all controls before first play, except for the center play button | ||
*/ | ||
theoplayer-ui:not([has-first-play]) .top-chrome, | ||
theoplayer-ui:not([has-first-play]) .side-chrome, | ||
theoplayer-ui:not([has-first-play]) .bottom-chrome { | ||
display: none !important; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
layout: example | ||
title: Portrait UI | ||
permalink: /examples/portrait-ui | ||
--- | ||
|
||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
<link href="portrait.css" rel="stylesheet" /> | ||
<div class="container"> | ||
<div class="phone"> | ||
<theoplayer-ui | ||
configuration='{"libraryLocation":"https://cdn.theoplayer.com/dash/theoplayer/","license":"{{ site.theoplayer_license }}","allowNativeFullscreen":true}' | ||
source='{"sources":"https://cdn.theoplayer.com/video/skating-portrait.mp4"}' | ||
device-type="mobile" | ||
> | ||
<theoplayer-control-bar slot="top-chrome" class="top-chrome"> | ||
<theoplayer-settings-menu-button menu="settings-menu" mobile-only></theoplayer-settings-menu-button> | ||
</theoplayer-control-bar> | ||
<theoplayer-loading-indicator slot="centered-loading" no-auto-hide></theoplayer-loading-indicator> | ||
<div slot="centered-chrome" class="centered-chrome"> | ||
<theoplayer-play-button></theoplayer-play-button> | ||
</div> | ||
<div slot="middle-chrome" class="side-chrome"> | ||
<theoplayer-mute-button></theoplayer-mute-button> | ||
<theoplayer-button><span class="material-symbols-rounded">thumb_up</span></theoplayer-button> | ||
<theoplayer-button><span class="material-symbols-rounded">comment</span>️</theoplayer-button> | ||
<theoplayer-button>️<span class="material-symbols-rounded">share</span></theoplayer-button> | ||
</div> | ||
<div class="bottom-chrome"> | ||
<theoplayer-control-bar> | ||
<theoplayer-time-display></theoplayer-time-display> | ||
<span class="spacer"></span> | ||
<theoplayer-time-display remaining></theoplayer-time-display> | ||
</theoplayer-control-bar> | ||
<theoplayer-control-bar> | ||
<theoplayer-time-range></theoplayer-time-range> | ||
</theoplayer-control-bar> | ||
</div> | ||
<theoplayer-settings-menu id="settings-menu" slot="menu" hidden></theoplayer-settings-menu> | ||
<theoplayer-error-display slot="error"></theoplayer-error-display> | ||
</theoplayer-ui> | ||
</div> | ||
</div> | ||
|
||
<p style="margin-top: 2em">Video by <a href="https://www.pexels.com/video/the-art-of-skateboarding-2791956/">cottonbro studio</a>.</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters