-
Notifications
You must be signed in to change notification settings - Fork 137
Closed
Description
Hi 👋
Is it possible to change start position during custom manifest loading?
So we want to start stream from certain position using loadVideo method, e.g.
Set base loadVideo config:
{
autoPlay: true,
startAt: { position: 10 },
transport: "dash",
url: "some url",
manifestLoader: customManifestLoader
}
Parse manifest data and modify offset:
customManifestLoader = (manifestData, callback) => {
const { url } = manifestInfo;
const xhr = new XMLHttpRequest();
const baseTime = performance.now();
xhr.onload = (r) => {
if (200 <= xhr.status && xhr.status < 300) {
let streamDuration = null;
function parseISODuration(duration: string): number {
.....
// parser logic
}
const data = xhr.response;
const mpdElement = data?.querySelector("MPD");
streamDuration = mpdElement?.getAttribute("mediaPresentationDuration");
...
// Some logic based on duration
...
// New start position value
// Best way to set a new start position?
}
};
// Some manifest stuff
}
So far I have logic where loadVideo is called and then after stream is ready seekTo, so yep it's not the most efficient.
I will be grateful for your help ;)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels