Skip to content

Commit

Permalink
Add chapterInfo MediaMetadata to video media session sample
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufortfrancois committed Apr 2, 2024
1 parent c4f3954 commit 7bcc007
Showing 1 changed file with 64 additions and 4 deletions.
68 changes: 64 additions & 4 deletions media-session/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,22 @@ function getAwesomePlaylist() {
{ src: BASE_URL + 'sintel/artwork-256.png', sizes: '256x256', type: 'image/png' },
{ src: BASE_URL + 'sintel/artwork-384.png', sizes: '384x384', type: 'image/png' },
{ src: BASE_URL + 'sintel/artwork-512.png', sizes: '512x512', type: 'image/png' },
]
],
chapterInfo: [{
title: 'Chapter 1',
startTime: 0,
artwork: [
{ src: BASE_URL + 'sintel/chapter1-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'sintel/chapter1-512.png', sizes: '512x512', type: 'image/png'},
]
}, {
title: 'Chapter 2',
startTime: 37,
artwork: [
{ src: BASE_URL + 'sintel/chapter2-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'sintel/chapter2-512.png', sizes: '512x512', type: 'image/png'},
]
}]
}, {
src: BASE_URL + 'big-buck-bunny/trailer.mov',
title: '"Big Buck Bunny" Trailer, Peach Open Movie Project',
Expand All @@ -168,7 +183,22 @@ function getAwesomePlaylist() {
{ src: BASE_URL + 'big-buck-bunny/artwork-256.png', sizes: '256x256', type: 'image/png' },
{ src: BASE_URL + 'big-buck-bunny/artwork-384.png', sizes: '384x384', type: 'image/png' },
{ src: BASE_URL + 'big-buck-bunny/artwork-512.png', sizes: '512x512', type: 'image/png' },
]
],
chapterInfo: [{
title: 'Chapter 1',
startTime: 0,
artwork: [
{ src: BASE_URL + 'big-buck-bunny/chapter1-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'big-buck-bunny/chapter1-512.png', sizes: '512x512', type: 'image/png'},
]
}, {
title: 'Chapter 2',
startTime: 16,
artwork: [
{ src: BASE_URL + 'big-buck-bunny/chapter2-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'big-buck-bunny/chapter2-512.png', sizes: '512x512', type: 'image/png'},
]
}]
}, {
src: BASE_URL + 'elephants-dream/teaser.mp4',
title: '"Elephants Dream" Teaser, Orange Open Movie Project',
Expand All @@ -180,7 +210,22 @@ function getAwesomePlaylist() {
{ src: BASE_URL + 'elephants-dream/artwork-256.png', sizes: '256x256', type: 'image/png' },
{ src: BASE_URL + 'elephants-dream/artwork-384.png', sizes: '384x384', type: 'image/png' },
{ src: BASE_URL + 'elephants-dream/artwork-512.png', sizes: '512x512', type: 'image/png' },
]
],
chapterInfo: [{
title: 'Chapter 1',
startTime: 0,
artwork: [
{ src: BASE_URL + 'elephants-dream/chapter1-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'elephants-dream/chapter1-512.png', sizes: '512x512', type: 'image/png'},
]
}, {
title: 'Chapter 2',
startTime: 64,
artwork: [
{ src: BASE_URL + 'elephants-dream/chapter2-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'elephants-dream/chapter2-512.png', sizes: '512x512', type: 'image/png'},
]
}]
}, {
src: BASE_URL + 'caminandes/short.mp4',
title: '"Caminandes 2: Gran Dillama" - Blender Animated Short',
Expand All @@ -192,6 +237,21 @@ function getAwesomePlaylist() {
{ src: BASE_URL + 'caminandes/artwork-256.png', sizes: '256x256', type: 'image/png' },
{ src: BASE_URL + 'caminandes/artwork-384.png', sizes: '384x384', type: 'image/png' },
{ src: BASE_URL + 'caminandes/artwork-512.png', sizes: '512x512', type: 'image/png' },
]
],
chapterInfo: [{
title: 'Chapter 1',
startTime: 0,
artwork: [
{ src: BASE_URL + 'caminandes/chapter1-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'caminandes/chapter1-512.png', sizes: '512x512', type: 'image/png'},
]
}, {
title: 'Chapter 2',
startTime: 94,
artwork: [
{ src: BASE_URL + 'caminandes/chapter2-128.png', sizes: '128x128', type: 'image/png'},
{ src: BASE_URL + 'caminandes/chapter2-512.png', sizes: '512x512', type: 'image/png'},
]
}]
}];
}

0 comments on commit 7bcc007

Please sign in to comment.