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

feat(demo): add DRM support to demo page #68

Merged
merged 1 commit into from
Nov 8, 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
5 changes: 3 additions & 2 deletions demo/src/ExampleDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ dialog.querySelector('#pbw-dialog-close-btn').addEventListener('click', () => di
* @param {object} options - An object containing the source and type of the video to be played.
* @param {string} options.src - The source URL of the video.
* @param {string} [options.type] - (Optional) The type/format of the video (e.g., 'video/mp4').
* @param {object} [options.keySystems] - (Optional) The DRM configuration for DRM protected sources.
*/
export const openModal = async ({ src, type }) => {
export const openModal = async ({ src, type, keySystems }) => {
const player = Pillarbox.getPlayer('player');

if (player.currentSrc() !== src) {
player.src({ src, type });
player.src({ src, type, keySystems });
}

dialog.showModal();
Expand Down
8 changes: 6 additions & 2 deletions demo/src/Examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ export const EXAMPLES = {
{
'title': 'VoD - Dash Widewine cenc (H264)',
'src': 'https://storage.googleapis.com/wvmedia/cenc/h264/tears/tears.mpd',
'licenseUrl': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'
'keySystems': {
'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'
}
},
{
'title': 'VoD - Dash (H265)',
Expand All @@ -232,7 +234,9 @@ export const EXAMPLES = {
{
'title': 'VoD - Dash widewine cenc (H265)',
'src': 'https://storage.googleapis.com/wvmedia/cenc/hevc/tears/tears.mpd',
'licenseUrl': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'
'keySystems': {
'com.widevine.alpha': 'https://proxy.uat.widevine.com/proxy?video_id=2015_tears&provider=widevine_test'
}
},
{
'title': 'VoD - Dash - MP4',
Expand Down