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

feat!: Remove DOM Parser #6063

Merged
merged 26 commits into from
Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
26 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
1 change: 1 addition & 0 deletions build/types/core
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
+../../lib/util/ts_parser.js
+../../lib/util/uint8array_utils.js
+../../lib/util/xml_utils.js
+../../lib/util/tXml.js

+../../third_party/closure-uri/uri.js
+../../third_party/closure-uri/utils.js
Expand Down
31 changes: 25 additions & 6 deletions externs/shaka/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ shaka.extern.MetadataFrame;
* startTime: number,
* endTime: number,
* id: string,
* eventElement: Element
* eventElement: ?shaka.extern.xml.Node
* }}
*
* @description
Expand All @@ -539,7 +539,7 @@ shaka.extern.MetadataFrame;
* The presentation time (in seconds) that the region should end.
* @property {string} id
* Specifies an identifier for this instance of the region.
* @property {Element} eventElement
* @property {?shaka.extern.xml.Node} eventElement
* The XML element that defines the Event.
* @exportDoc
*/
Expand Down Expand Up @@ -840,6 +840,25 @@ shaka.extern.DrmConfiguration;
shaka.extern.InitDataTransform;


/**
* @typedef {{
* tagName: !string,
* attributes: !Object<string, string>,
* children: !Array.<shaka.extern.xml.Node | string>
* }}
*
* @description
* Data structure for xml nodes as simple objects
*
* @property {!string} tagName
* The name of the element
* @property {!object} attributes
* The attributes of the element
* @property {!Array.<shaka.extern.xml.Node | string>} children
* The child nodes or string body of the element
*/
shaka.extern.xml.Node;

/**
* @typedef {{
* clockSyncUri: string,
Expand All @@ -853,7 +872,7 @@ shaka.extern.InitDataTransform;
* ignoreEmptyAdaptationSet: boolean,
* ignoreMaxSegmentDuration: boolean,
* keySystemsByURI: !Object.<string, string>,
* manifestPreprocessor: function(!Element),
* manifestPreprocessor: function(!shaka.extern.xml.Node),
* sequenceMode: boolean,
* enableAudioGroups: boolean,
* multiTypeVariantsAllowed: boolean
Expand Down Expand Up @@ -906,7 +925,7 @@ shaka.extern.InitDataTransform;
* @property {Object.<string, string>} keySystemsByURI
* A map of scheme URI to key system name. Defaults to default key systems
* mapping handled by Shaka.
* @property {function(!Element)} manifestPreprocessor
* @property {function(!shaka.extern.xml.Node)} manifestPreprocessor
* Called immediately after the DASH manifest has been parsed into an
* XMLDocument. Provides a way for applications to perform efficient
* preprocessing of the manifest.
Expand Down Expand Up @@ -1018,12 +1037,12 @@ shaka.extern.HlsManifestConfiguration;

/**
* @typedef {{
* manifestPreprocessor: function(!Element),
* manifestPreprocessor: function(!shaka.extern.xml.Node),
* sequenceMode: boolean,
* keySystemsBySystemId: !Object.<string, string>
* }}
*
* @property {function(!Element)} manifestPreprocessor
* @property {function(!shaka.extern.xml.Node)} manifestPreprocessor
* Called immediately after the MSS manifest has been parsed into an
* XMLDocument. Provides a way for applications to perform efficient
* preprocessing of the manifest.
Expand Down
2 changes: 1 addition & 1 deletion lib/ads/ad_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ shaka.ads.AdManager = class extends shaka.util.FakeEventTarget {
if (this.ssAdManager_ && region.schemeIdUri == 'urn:google:dai:2018') {
const type = region.schemeIdUri;
const data = region.eventElement ?
region.eventElement.getAttribute('messageData') : null;
region.eventElement.attributes['messageData'] : null;
const timestamp = region.startTime;
this.ssAdManager_.onTimedMetadata(type, data, timestamp);
}
Expand Down
Loading
Loading