Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Add mime types and codecs to segment references
  • Loading branch information
absidue committed Apr 4, 2025
commit b8b395be7758665bcccbf95b9839a32b8d31bef8
9 changes: 9 additions & 0 deletions src/renderer/helpers/player/SabrManifestParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,9 @@ function createTextStreams(captions, presentationTimeline, currentId) {
presentationTimeline.getDuration(),
[caption.url]
)

stream.segmentIndex.get(0).mimeType = caption.mimeType

return Promise.resolve()
},
closeSegmentIndex: () => {
Expand Down Expand Up @@ -688,6 +691,7 @@ function createVodMediaSegmentIndex(url, response, format, stream, duration) {
initSegmentReference.mimeType = stream.mimeType
initSegmentReference.codecs = stream.codecs

/** @type {shaka.media.SegmentReference[] | undefined} */
let references

if (stream.mimeType.endsWith('/webm')) {
Expand All @@ -696,6 +700,11 @@ function createVodMediaSegmentIndex(url, response, format, stream, duration) {
references = /** @__NOINLINE__ */ parseMp4SegmentIndex(indexData, format.indexRange.start, url, initSegmentReference, 0, 0, duration)
}

for (const reference of references) {
reference.mimeType = stream.mimeType
reference.codecs = stream.codecs
}

return new shaka.media.SegmentIndex(references)
}

Expand Down