Skip to content

Commit

Permalink
Integrating Cta608Parser From SVTA's Comon-Media-Library (#4522)
Browse files Browse the repository at this point in the history
* Delete cea608-parser.js

Deleted this since we are now using Cta608Parser from common-media-library instead

* Update MediaPlayer.js

setting Cta608Parser from comon-media-library for adapter to use

* Update TextSourceBuffer.js

Switching to Cta608Parser from common-media-library. Also includes changes that fixes emulation prevention bytes in cea-608 parsing. See #3719

* Update package.json

new dependency for common-media-library version 0.7.0

* Update package-lock.json

* Update dash.DashAdapter.js

correcting unit test for the parser

* Update package.json

* Update package-lock.json

* Update package.json

* Update package-lock.json

* Update webpack.config.js

Configured polyfill for timers to resolve build issues related to xml2js dependency

* Update webpack.config.js

* Update package.json

* Update package-lock.json

* Update package.json

* Update package-lock.json

* fix: missing karam dep

---------

Co-authored-by: Casey Occhialini <[email protected]>
  • Loading branch information
agajassi and littlespex authored Jul 1, 2024
1 parent f4840e8 commit 3f9ecab
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 1,288 deletions.
1,246 changes: 0 additions & 1,246 deletions externals/cea608-parser.js

This file was deleted.

10 changes: 5 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as CommonMediaLibrary from '@svta/common-media-library';
import { CommonMediaRequest, CommonMediaResponse, RequestInterceptor, ResponseInterceptor } from '@svta/common-media-library/request'

export = dashjs;
export as namespace dashjs;
Expand Down Expand Up @@ -1527,13 +1527,13 @@ declare namespace dashjs {

setProtectionData(value: ProtectionDataSet): void;

addRequestInterceptor(interceptor: CommonMediaLibrary.RequestInterceptor): void;
addRequestInterceptor(interceptor: RequestInterceptor): void;

removeRequestInterceptor(interceptor: CommonMediaLibrary.RequestInterceptor): void;
removeRequestInterceptor(interceptor: RequestInterceptor): void;

addResponseInterceptor(interceptor: CommonMediaLibrary.ResponseInterceptor): void;
addResponseInterceptor(interceptor: ResponseInterceptor): void;

removeResponseInterceptor(interceptor: CommonMediaLibrary.ResponseInterceptor): void;
removeResponseInterceptor(interceptor: ResponseInterceptor): void;

registerLicenseRequestFilter(filter: RequestFilter): void;

Expand Down
127 changes: 117 additions & 10 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"sinon": "^17.0.1",
"stream-browserify": "^3.0.0",
"string-replace-loader": "^3.1.0",
"timers-browserify": "^2.0.12",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
Expand All @@ -56,7 +57,7 @@
"yargs": "^17.7.2"
},
"dependencies": {
"@svta/common-media-library": "^0.6.4",
"@svta/common-media-library": "^0.7.1",
"bcp-47-match": "^2.0.3",
"bcp-47-normalize": "^2.3.0",
"codem-isoboxer": "0.3.9",
Expand Down
4 changes: 2 additions & 2 deletions src/streaming/MediaPlayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
import cea608parser from '../../externals/cea608-parser.js';
import {Cta608Parser} from '@svta/common-media-library/cta/608/Cta608Parser';
import Constants from './constants/Constants.js';
import DashConstants from '../dash/constants/DashConstants.js';
import MetricsConstants from './constants/MetricsConstants.js';
Expand Down Expand Up @@ -371,7 +371,7 @@ function MediaPlayer() {

adapter.setConfig({
constants: Constants,
cea608parser: cea608parser,
cea608parser: new Cta608Parser(),
errHandler: errHandler,
BASE64: BASE64
});
Expand Down
4 changes: 2 additions & 2 deletions src/streaming/net/FetchLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ function FetchLoader() {

/**
* Load request
* @param {CommonMediaLibrary.request.CommonMediaRequest} httpRequest
* @param {CommonMediaLibrary.request.CommonMediaResponse} httpResponse
* @param {CommonMediaRequest} httpRequest
* @param {CommonMediaResponse} httpResponse
*/
function load(httpRequest, httpResponse) {
// Variables will be used in the callback functions
Expand Down
6 changes: 3 additions & 3 deletions src/streaming/net/HTTPLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ function HTTPLoader(cfg) {
const traces = [];
let firstProgress, requestStartTime, lastTraceTime, lastTraceReceivedCount, progressTimeout;

let httpRequest; // CommonMediaLibrary.request.CommonMediaRequest
let httpResponse; // CommonMediaLibrary.request.CommonMediaResponse
let httpRequest; // CommonMediaRequest
let httpResponse; // CommonMediaResponse

requestObject.bytesLoaded = NaN;
requestObject.bytesTotal = NaN;
Expand Down Expand Up @@ -400,7 +400,7 @@ function HTTPLoader(cfg) {
customData: { request: requestObject }
};

// Init response (CommonMediaLibrary.request.CommoneMediaResponse)
// Init response (CommoneMediaResponse)
httpResponse = {
request: httpRequest,
resourceTiming: {
Expand Down
4 changes: 2 additions & 2 deletions src/streaming/net/XHRLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function XHRLoader() {

/**
* Load request
* @param {CommonMediaLibrary.request.CommonMediaRequest} httpRequest
* @param {CommonMediaLibrary.request.CommonMediaResponse} httpResponse
* @param {CommonMediaRequest} httpRequest
* @param {CommonMediaResponse} httpResponse
*/
function load(httpRequest, httpResponse) {
xhr = new XMLHttpRequest();
Expand Down
Loading

0 comments on commit 3f9ecab

Please sign in to comment.