Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
remove getIsOnDemand, getIsDVB and hasProfile functions : not used.
Browse files Browse the repository at this point in the history
In my opinion, if a function is only used in test unit file, it has to be deleted.
  • Loading branch information
nicosang committed Jun 7, 2017
1 parent acdfcf4 commit ad56de8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
20 changes: 0 additions & 20 deletions src/dash/models/DashManifestModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,24 +279,6 @@ function DashManifestModel() {
return isDynamic;
}

function hasProfile(manifest, profile) {
var has = false;

if (manifest.profiles && manifest.profiles.length > 0) {
has = (manifest.profiles.indexOf(profile) !== -1);
}

return has;
}

function getIsOnDemand(manifest) {
return hasProfile(manifest, 'urn:mpeg:dash:profile:isoff-on-demand:2011');
}

function getIsDVB(manifest) {
return hasProfile(manifest, 'urn:dvb:dash:profile:dvb-dash:2014');
}

function getDuration(manifest) {
var mpdDuration;
//@mediaPresentationDuration specifies the duration of the entire Media Presentation.
Expand Down Expand Up @@ -895,8 +877,6 @@ function DashManifestModel() {
getKID: getKID,
getContentProtectionData: getContentProtectionData,
getIsDynamic: getIsDynamic,
getIsOnDemand: getIsOnDemand,
getIsDVB: getIsDVB,
getDuration: getDuration,
getBandwidth: getBandwidth,
getManifestUpdatePeriod: getManifestUpdatePeriod,
Expand Down
30 changes: 0 additions & 30 deletions test/unit/dash.DashManifestModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,36 +12,6 @@ const SERVICE_LOCATION = 'testServiceLocation';

describe('DashManifestModel', function () {

it('should return true when getIsDVB is called and manifest contains a valid DVB profile', () => {
const manifest = {
profiles: 'urn:dvb:dash:profile:dvb-dash:2014,urn:dvb:dash:profile:dvb-dash:isoff-ext-live:2014'
};

const isDVB = dashManifestModel.getIsDVB(manifest);

expect(isDVB).to.be.true; // jshint ignore:line
});

it('should return false when getIsDVB is called and manifest does not contain a valid DVB profile', () => {
const manifest = {
profiles: 'urn:mpeg:dash:profile:isoff-on-demand:2011, http://dashif.org/guildelines/dash264'
};

const isDVB = dashManifestModel.getIsDVB(manifest);

expect(isDVB).to.be.false; // jshint ignore:line
});

it('should return true when getIsOnDemand is called and manifest contains the on-demand profile', () => {
const manifest = {
profiles: 'urn:dvb:dash:profile:dvb-dash:2014,urn:mpeg:dash:profile:isoff-on-demand:2011'
};

const isOnDemand = dashManifestModel.getIsOnDemand(manifest);

expect(isOnDemand).to.be.true; // jshint ignore:line
});

it('should return NaN when minimumUpdatePeriod is not present in manifest', () => {
const manifest = {};
const updatePeriod = dashManifestModel.getManifestUpdatePeriod(manifest);
Expand Down

0 comments on commit ad56de8

Please sign in to comment.