Adds support for the messageData attribute of the Event element in DASH MPDs for ExoPlayer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=211854408
This commit is contained in:
josephmarques 2018-09-06 12:58:39 -07:00 committed by Oliver Woodman
parent f47f1b9f4b
commit aa7134d538
3 changed files with 11 additions and 2 deletions

View File

@ -38,6 +38,8 @@
([#4422](https://github.com/google/ExoPlayer/issues/4422)).
* Fix the bitrate being unset on primary track sample formats
([#3297](https://github.com/google/ExoPlayer/issues/3297)).
* DASH:
* Support messageData attribute of in-manifest events.
* Improve seeking support for progressive streams:
* Support seeking in MPEG-TS
([#966](https://github.com/google/ExoPlayer/issues/966)).

View File

@ -838,8 +838,15 @@ public class DashManifestParser extends DefaultHandler
long durationMs = Util.scaleLargeTimestamp(duration, 1000, timescale);
long presentationTimesUs = Util.scaleLargeTimestamp(presentationTime, C.MICROS_PER_SECOND,
timescale);
String messageData = parseString(xpp, "messageData", null);
byte[] eventObject = parseEventObject(xpp, scratchOutputStream);
return buildEvent(schemeIdUri, value, id, durationMs, eventObject, presentationTimesUs);
return buildEvent(
schemeIdUri,
value,
id,
durationMs,
messageData == null ? eventObject : Util.getUtf8Bytes(messageData),
presentationTimesUs);
}
/**

View File

@ -2,7 +2,7 @@
<MPD xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:mpeg:DASH:schema:MPD:2011" xmlns:yt="http://youtube.com/yt/2012/10/10" xsi:schemaLocation="urn:mpeg:DASH:schema:MPD:2011 DASH-MPD.xsd" minBufferTime="PT1.500S" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="dynamic" availabilityStartTime="2016-10-14T17:00:17" timeShiftBufferDepth="PT7200.000S" minimumUpdatePeriod="PT2.000S" yt:earliestMediaSequence="0" yt:mpdRequestTime="2016-10-14T18:29:17.082" yt:mpdResponseTime="2016-10-14T18:29:17.194">
<Period start="PT0.000S" yt:segmentIngestTime="2016-10-14T17:00:14.257">
<EventStream schemeIdUri="urn:uuid:XYZY" timescale="1000" value="call">
<Event presentationTime="0" duration="10000" id="0">+ 1 800 10101010</Event>
<Event presentationTime="0" duration="10000" id="0" messageData="+ 1 800 10101010"/>
</EventStream>
<EventStream schemeIdUri="urn:dvb:iptv:cpm:2014">
<Event presentationTime="300" duration="1500" id="1"><![CDATA[<BroadcastEvent>