Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DE-6596: VU meter component #15

Merged
merged 8 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
(or `PrestoContext`), in which case it is not necessary to pass the `player` argument anymore.
* `HoverContainer` no longer accepts props `listenToHover` and `notTrackFullWidth`.

## New Features

* VU Meter component.

## Fixes

* Fixes to `BaseThemeOverlay`:
Expand Down
8 changes: 4 additions & 4 deletions app/src/Asset.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { clpp } from '@castlabs/prestoplay'
import { clpp } from '@castlabs/prestoplay'

export interface Asset {
/**
* The player load configuration
*/
config: clpp.LoadConfig
config: clpp.PlayerConfiguration
/**
* Optional asset title
*/
Expand Down Expand Up @@ -40,7 +40,7 @@ export const TestAssets: Asset[] = [
config: {
source: {
url: 'https://content.players.castlabs.com/demos/drm-agent/manifest.mpd',
type: 'application/dash+xml',
type: clpp.Type.DASH,
drmProtected: true,
},
autoplay: true,
Expand Down Expand Up @@ -72,7 +72,7 @@ export const TestAssets: Asset[] = [
config: {
source: {
url: 'https://content.players.castlabs.com/demos/clear-segmented/master.m3u8',
type: 'application/x-mpegurl',
type: clpp.Type.HLS,
drmProtected: false,
},
autoplay: false,
Expand Down
2 changes: 1 addition & 1 deletion app/src/YoutubeControlsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const Ui = (props: PropsUi) => {
const playerEnabled = usePrestoEnabledState(player)

return (
<PlayerControls showWhenDisabled={true}>
<PlayerControls>

<div className="pp-yt-gradient-bottom"></div>

Expand Down
114 changes: 114 additions & 0 deletions docs/vu_meter_avg.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<mxfile host="65bd71144e">
<diagram id="V7tNr58Itoe770vllYT3" name="Page-1">
<mxGraphModel dx="457" dy="466" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;dashed=1;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="450" y="170" width="80" height="180" as="geometry"/>
</mxCell>
<mxCell id="3" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;dashed=1;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="530" y="170" width="80" height="180" as="geometry"/>
</mxCell>
<mxCell id="4" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;dashed=1;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="370" y="170" width="80" height="180" as="geometry"/>
</mxCell>
<mxCell id="5" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="70" y="170" width="40" height="180" as="geometry"/>
</mxCell>
<mxCell id="6" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="110" y="320" width="40" height="30" as="geometry"/>
</mxCell>
<mxCell id="7" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="150" y="250" width="40" height="100" as="geometry"/>
</mxCell>
<mxCell id="8" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="190" y="200" width="40" height="150" as="geometry"/>
</mxCell>
<mxCell id="9" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="230" y="320" width="40" height="30" as="geometry"/>
</mxCell>
<mxCell id="10" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="270" y="290" width="40" height="60" as="geometry"/>
</mxCell>
<mxCell id="11" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="370" y="170" width="40" height="180" as="geometry"/>
</mxCell>
<mxCell id="12" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="410" y="320" width="40" height="30" as="geometry"/>
</mxCell>
<mxCell id="13" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="450" y="250" width="40" height="100" as="geometry"/>
</mxCell>
<mxCell id="14" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="490" y="200" width="40" height="150" as="geometry"/>
</mxCell>
<mxCell id="15" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="530" y="320" width="40" height="30" as="geometry"/>
</mxCell>
<mxCell id="16" value="" style="rounded=0;whiteSpace=wrap;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="570" y="290" width="40" height="60" as="geometry"/>
</mxCell>
<mxCell id="17" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=5;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;fillColor=#d5e8d4;strokeColor=#82b366;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="50" y="270" as="sourcePoint"/>
<mxPoint x="330" y="270" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="18" value="AVG" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=20;fontFamily=Architects Daughter;" vertex="1" connectable="0" parent="17">
<mxGeometry x="0.4232" relative="1" as="geometry">
<mxPoint x="21" y="-20" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="19" value="Average across all amplitudes" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;dashed=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="90" y="110" width="190" height="30" as="geometry"/>
</mxCell>
<mxCell id="20" value="Binned average" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;dashed=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;fontStyle=1" vertex="1" parent="1">
<mxGeometry x="380" y="110" width="190" height="30" as="geometry"/>
</mxCell>
<mxCell id="21" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=4;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;fillColor=#d5e8d4;strokeColor=#82b366;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="450" y="220" as="sourcePoint"/>
<mxPoint x="530" y="220" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="22" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;fillColor=#f5f5f5;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="530" y="310.3700000000001" as="sourcePoint"/>
<mxPoint x="610" y="310" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="23" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;fillColor=#f5f5f5;strokeColor=#666666;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="380" y="269.37000000000035" as="sourcePoint"/>
<mxPoint x="460" y="269" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="24" value="AVG" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=20;fontFamily=Architects Daughter;" vertex="1" connectable="0" parent="23">
<mxGeometry x="0.4232" relative="1" as="geometry">
<mxPoint x="-27" y="-19" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="25" value="AVG" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=20;fontFamily=Architects Daughter;" vertex="1" connectable="0" parent="1">
<mxGeometry x="420.4993850293971" y="260.10406534423896" as="geometry">
<mxPoint x="140" y="29" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="26" value="AVG" style="edgeLabel;html=1;align=center;verticalAlign=middle;resizable=0;points=[];fontSize=20;fontFamily=Architects Daughter;" vertex="1" connectable="0" parent="1">
<mxGeometry x="349.9993850293971" y="160.00406534423897" as="geometry">
<mxPoint x="140" y="29" as="offset"/>
</mxGeometry>
</mxCell>
<mxCell id="27" value="" style="endArrow=classic;html=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;strokeWidth=2;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=16;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="620" y="100" as="sourcePoint"/>
<mxPoint x="500" y="220" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="28" value="&lt;font style=&quot;font-size: 14px;&quot;&gt;Winner, this will be displayed&lt;/font&gt;" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;dashed=1;sketch=1;hachureGap=4;jiggle=2;curveFitting=1;fontFamily=Architects Daughter;fontSource=https%3A%2F%2Ffonts.googleapis.com%2Fcss%3Ffamily%3DArchitects%2BDaughter;fontSize=20;" vertex="1" parent="1">
<mxGeometry x="590" y="70" width="130" height="30" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
23 changes: 17 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@babel/preset-env": "^7.22.4",
"@babel/preset-react": "^7.22.3",
"@babel/preset-typescript": "^7.21.5",
"@castlabs/prestoplay": "^6.2.7",
"@castlabs/prestoplay": "^6.6.0",
"@finga/eslint-config": "^1.2.1",
"@rollup/plugin-commonjs": "^23.0.2",
"@rollup/plugin-image": "^3.0.2",
Expand Down Expand Up @@ -89,7 +89,7 @@
"typescript": "^4.8.4"
},
"peerDependencies": {
"@castlabs/prestoplay": "~6.2.0",
"@castlabs/prestoplay": "^6.6.0",
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
Expand Down
Loading