diff --git a/package-lock.json b/package-lock.json
index a2f5bfe..93c5034 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "MIT",
"dependencies": {
- "@srgssr/pillarbox-web": "^1.0.1",
+ "@srgssr/pillarbox-web": "^1.1.0",
"highlight.js": "^11.9.0",
"lit": "^3.1.1",
"material-icons": "^1.13.12",
@@ -1739,9 +1739,9 @@
]
},
"node_modules/@srgssr/pillarbox-web": {
- "version": "1.0.1",
- "resolved": "https://npm.pkg.github.com/download/@srgssr/pillarbox-web/1.0.1/66c4f497e5ee04d495fd2007110f9cfccf5bd437",
- "integrity": "sha512-4MitZ6iMtYWLjWJUlTnFGz5Ap3v3zJ8AFUyH1+yQpJjdwfd4yUePv5umNkte20rpdMF0iBleMu4L7IPklsHOvA==",
+ "version": "1.1.0",
+ "resolved": "https://npm.pkg.github.com/download/@srgssr/pillarbox-web/1.1.0/3001926a2ae32e2996b39e690634e06e45252ebe",
+ "integrity": "sha512-hZG/iPyA4HK/Fzy7iPMxKFuc1Ed40mn7bUD05tVi185d3AsiXZbrcpRfRT7vJo/NeBAzFY+s3tQsOqI6aYMaDQ==",
"license": "MIT",
"dependencies": {
"video.js": "^8.11.1",
diff --git a/package.json b/package.json
index 348b9fb..79c126f 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"vite": "^5.0.12"
},
"dependencies": {
- "@srgssr/pillarbox-web": "^1.0.1",
+ "@srgssr/pillarbox-web": "^1.1.0",
"highlight.js": "^11.9.0",
"lit": "^3.1.1",
"material-icons": "^1.13.12",
diff --git a/src/layout/content/showcase/showcase-page.js b/src/layout/content/showcase/showcase-page.js
index 1776b0b..3d84c3c 100644
--- a/src/layout/content/showcase/showcase-page.js
+++ b/src/layout/content/showcase/showcase-page.js
@@ -5,19 +5,30 @@ import './showcase-component.js';
import '../../../components/code-block/code-block';
import showcasePageCss from './showcase-page.scss?inline';
import rawStartTimeExample from '../../../../static/showcases/start-time.html?raw';
-import raeMultiPlayerExample from '../../../../static/showcases/multi-player.html?raw';
+import rawMultiPlayerExample from '../../../../static/showcases/multi-player.html?raw';
+import rawDetectBlockedSegmentsExample from '../../../../static/showcases/blocked-segment.html?raw';
+import rawDisplayCurrentChapterExample from '../../../../static/showcases/chapters.html?raw';
+import rawSkipCreditsExample from '../../../../static/showcases/skip-credits.html?raw';
import { getTextFromHTML } from './example-parser.js';
const startTimeExampleTxt = getTextFromHTML(rawStartTimeExample);
-const multiPlayerExampleTxt = getTextFromHTML(raeMultiPlayerExample);
+const multiPlayerExampleTxt = getTextFromHTML(rawMultiPlayerExample);
+const detectBlockedSegmentsExampleTxt =
+ getTextFromHTML(rawDetectBlockedSegmentsExample);
+const displayCurrentChapterExampleTxt =
+ getTextFromHTML(rawDisplayCurrentChapterExample);
+const skipCreditsExampleTxt = getTextFromHTML(rawSkipCreditsExample);
export class ShowCasePage extends LitElement {
static styles = [theme, animations, unsafeCSS(showcasePageCss)];
render() {
return html`
- ${this.#renderStartTime()}
- ${this.#renderMultiplePlayers()}
+ ${this.#renderStartTime()}
+ ${this.#renderMultiplePlayers()}
+ ${this.#renderDetectBlockedSegments()}
+ ${this.#renderDisplayCurrentChapter()}
+ ${this.#renderSkipCredits()}
`;
}
@@ -45,21 +56,82 @@ export class ShowCasePage extends LitElement {
#renderMultiplePlayers() {
return html`
-
e.target.classList.remove('fade-in')}">
-
- Multiple Players
-
- This example demonstrates how to incorporate multiple video players
- on a webpage.In this showcase, two players are initialized, each
- with its own configuration, a button allows to toggle the mute state
- for both players.
-
- ${multiPlayerExampleTxt}
-
-
- Open this showcase
-
-
+ e.target.classList.remove('fade-in')}">
+
+ Multiple Players
+
+ This example demonstrates how to incorporate multiple video players
+ on a webpage.In this showcase, two players are initialized, each
+ with its own configuration, a button allows to toggle the mute state
+ for both players.
+
+ ${multiPlayerExampleTxt}
+
+
+ Open this showcase
+
+
+ `;
+ }
+
+ #renderDetectBlockedSegments() {
+ return html`
+ e.target.classList.remove('fade-in')}">
+
+ Detect Blocked Segments
+
+ This tutorial covers how to use pillarbox to create a plugin that
+ detects and notifies when a blocked segment is skipped.
+
+ ${detectBlockedSegmentsExampleTxt}
+
+
+ Open this showcase
+
+
+ `;
+ }
+
+ #renderDisplayCurrentChapter() {
+ return html`
+ e.target.classList.remove('fade-in')}">
+
+ Display Current Chapter
+
+ This showcase explains how to use pillarbox to create a plugin that
+ displays the currently playing chapter in a box above the progress
+ bar.
+
+ ${displayCurrentChapterExampleTxt}
+
+
+ Open this showcase
+
+
+ `;
+ }
+
+ #renderSkipCredits() {
+ return html`
+ e.target.classList.remove('fade-in')}">
+
+ Skip Credits
+
+ This example shows how to use pillarbox to create a plugin that adds
+ a "Skip" button during detected credit intervals.
+
+ ${skipCreditsExampleTxt}
+
+
+ Open this showcase
+
+
`;
}
}
diff --git a/static/showcases/blocked-segment.html b/static/showcases/blocked-segment.html
new file mode 100644
index 0000000..4aed58d
--- /dev/null
+++ b/static/showcases/blocked-segment.html
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+ Pillarbox Demo - Detect blocked segment
+
+
+
+
+
+
+
+
+
Detect blocked segment
+
+
+
+
+
Close this window
+
+
+
+
+
+
+
+
diff --git a/static/showcases/blocked-segment.scss b/static/showcases/blocked-segment.scss
new file mode 100644
index 0000000..11f9738
--- /dev/null
+++ b/static/showcases/blocked-segment.scss
@@ -0,0 +1,16 @@
+.pbw-blocked-segment-notification {
+ position: absolute;
+ right: var(--size-5);
+ bottom: var(--size-9);
+ display: flex;
+ align-items: center;
+ height: var(--size-6);
+ color: white;
+ background-color: rgb(0 0 0 / 70%);
+ border-radius: var(--radius-3);
+ box-shadow: var(--shadow-3);
+ backdrop-filter: blur(5px);
+ padding-inline: var(--size-2);
+}
+
+
diff --git a/static/showcases/chapters-showcase.scss b/static/showcases/chapters-showcase.scss
new file mode 100644
index 0000000..d9b54fc
--- /dev/null
+++ b/static/showcases/chapters-showcase.scss
@@ -0,0 +1,43 @@
+.pbw-current-chapter {
+ position: absolute;
+ top: calc(var(--size-8) * -1);
+ left: var(--size-4);
+ display: flex;
+ width: var(--size-15);
+ height: var(--size-9);
+ color: white;
+ background-color: rgb(0 0 0 / 50%);
+ border-radius: var(--radius-2);
+ box-shadow: var(--shadow-3);
+ backdrop-filter: sepia(50%);
+}
+
+.vjs-layout-medium {
+ .pbw-current-chapter {
+ width: var(--size-14);
+ }
+}
+
+.vjs-layout-tiny,
+.vjs-layout-x-small,
+.vjs-layout-small {
+ .pbw-current-chapter {
+ display: none;
+ }
+}
+
+.pbw-chapter-title {
+ display: -webkit-box;
+ padding: var(--size-1) var(--size-2);
+ overflow: hidden;
+ font-weight: var(--font-weight-3);
+ text-overflow: ellipsis;
+ -webkit-line-clamp: 4;
+ -webkit-box-orient: vertical;
+}
+
+.pbw-chapter-thumbnail {
+ border-top-left-radius: var(--radius-2);
+ border-bottom-left-radius: var(--radius-2);
+ box-shadow: var(--inner-shadow-3);
+}
diff --git a/static/showcases/chapters.html b/static/showcases/chapters.html
new file mode 100644
index 0000000..7a22e4d
--- /dev/null
+++ b/static/showcases/chapters.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+ Pillarbox Demo - Display Current Chapter
+
+
+
+
+
+
+
+
+
Display Current Chapter
+
+
+
+
+
Close this window
+
+
+
+
+
+
+
+
diff --git a/static/showcases/skip-credits.html b/static/showcases/skip-credits.html
new file mode 100644
index 0000000..fe125b1
--- /dev/null
+++ b/static/showcases/skip-credits.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+ Pillarbox Demo - Skip Credits
+
+
+
+
+
+
+
+
+
Skip Credits
+
+
+
+
+
Close this window
+
+
+
+
+
+
+
+
diff --git a/static/showcases/skip-showcase.scss b/static/showcases/skip-showcase.scss
new file mode 100644
index 0000000..df526b8
--- /dev/null
+++ b/static/showcases/skip-showcase.scss
@@ -0,0 +1,18 @@
+.vjs-control.vjs-button.pbw-skip-btn {
+ position: absolute;
+ right: var(--size-5);
+ bottom: var(--size-9);
+ width: var(--size-10);
+ height: var(--size-6);
+ color: white;
+ background-color: rgb(0 0 0 / 70%);
+ border-radius: var(--radius-3);
+ box-shadow: var(--shadow-3);
+ cursor: pointer;
+ backdrop-filter: blur(5px);
+
+ .vjs-icon-placeholder::before {
+ font-size: var(--font-size-1);
+ content: 'Skip >>';
+ }
+}
diff --git a/static/showcases/static-showcase.scss b/static/showcases/static-showcase.scss
index 985568c..7f2783c 100644
--- a/static/showcases/static-showcase.scss
+++ b/static/showcases/static-showcase.scss
@@ -1,7 +1,7 @@
@import '../../scss/index';
body {
- max-width: var(--size-sm);
+ max-width: var(--size-md);
}
.showcase-content {