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

Resolve base url not correct when root MPD base url start with / #1440

Closed
KunXi-Fox opened this issue May 21, 2024 · 2 comments
Closed

Resolve base url not correct when root MPD base url start with / #1440

KunXi-Fox opened this issue May 21, 2024 · 2 comments

Comments

@KunXi-Fox
Copy link

KunXi-Fox commented May 21, 2024

Bug Description

Currently rx-player didn't resolve base url correctly when root MPD base url start with /

Expected behavior

resolve('/a/b/c', 'https://example.com/a') should return https://example.com/a/b/c not https://example.com/a/a/b/c

Details

MPD Example:

MPD base url is: https://example.com/dash/index.mpd

<?xml version="1.0" encoding="utf-8"?>
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="urn:mpeg:dash:schema:mpd:2011"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 http://standards.iso.org/ittf/PubliclyAvailableStandards/MPEG-DASH_schema_files/DASH-MPD.xsd"
	profiles="urn:mpeg:dash:profile:isoff-live:2011"
	type="dynamic"
	minimumUpdatePeriod="PT500S"
	suggestedPresentationDelay="PT1S"
	availabilityStartTime="2022-12-07T08:52:13.150Z"
	publishTime="2022-12-07T08:52:13.926Z"
	maxSegmentDuration="PT1.0S"
	minBufferTime="PT2.0S">
	<BaseURL>/a/b/c/</BaseURL>
	<Period id="0" start="PT0.0S">
		<AdaptationSet id="0" contentType="video" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true" frameRate="25/1" maxWidth="768" maxHeight="576" par="4:3">
			<Representation id="0" mimeType="video/mp4" codecs="avc1.640028" bandwidth="176736" width="768" height="576" sar="1:1">
				<SegmentTemplate timescale="1000000" duration="1000000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
				</SegmentTemplate>
			</Representation>
		</AdaptationSet>
		<AdaptationSet id="1" contentType="audio" startWithSAP="1" segmentAlignment="true" bitstreamSwitching="true">
			<Representation id="1" mimeType="audio/mp4" codecs="mp4a.40.2" bandwidth="69000" audioSamplingRate="44100">
				<AudioChannelConfiguration schemeIdUri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="1" />
				<SegmentTemplate timescale="1000000" duration="1000000" initialization="init-stream$RepresentationID$.m4s" media="chunk-stream$RepresentationID$-$Number%05d$.m4s" startNumber="1">
				</SegmentTemplate>
			</Representation>
		</AdaptationSet>
	</Period>
</MPD>

For first period

actual behavior

Expected Behavior
@KunXi-Fox KunXi-Fox changed the title Segment requesting error for multiple period and some of them has <BaseUrl> Resolve base url not correct when root MPD base url start with / May 24, 2024
@Florent-Bouisset
Copy link
Collaborator

Hello, It looks likes the URL resolution in the RxPlayer does not met the spec for absolute path.
From the DASH spec 5.6.4 Reference resolution:

URLs at each level of the MPD are resolved according to IETF RFC 3986

Which is defined here: https://datatracker.ietf.org/doc/html/rfc3986#section-5.4.1

The example that correspond to the absolute path case:

BaseURL: "http://a/b/c/d;p?q"
relativeReference: "/g"
Output = "http://a/g"

@Florent-Bouisset
Copy link
Collaborator

Fixed with 4.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants