Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 3 additions & 15 deletions dist/mi-angular-bitdash-player.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mi-angular-bitdash-player.min.js

Large diffs are not rendered by default.

18 changes: 2 additions & 16 deletions src/bitdash-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ class BitmovinController {

public getDVRPlaybackToPostlive(webcast: any): any {
let hls: string = webcast['liveStateData'].playout.hlsDvrUrl;
let dash: string = webcast['liveStateData'].playout.dashDvrUrl;
const title: string = webcast.name;

if (angular.isDefined(webcast['postliveStateData'].playout.offset)) {
Expand All @@ -58,21 +57,14 @@ class BitmovinController {
parser.href = webcast['liveStateData'].playout.hlsDvrUrl;
offsetPrefix = (parser.search) ? '&' : '?';
hls += `${offsetPrefix}wowzadvrplayliststart=${offset}000`;

if (angular.isDefined(dash) && dash) {
parser.href = dash;
offsetPrefix = (parser.search) ? '&' : '?';
dash += `${offsetPrefix}wowzadvrplayliststart=${offset}000`;
}
}
}

return {dash, hls, title};
return {hls, title};
}

public getPlayerConfigSourceByState(webcast: any, state: any): any {
let hls: string = webcast[state].playout.hlsUrl;
let dash: string = webcast[state].playout.dashUrl;
const title: string = webcast.name;
const hiveServiceUrl: string = this.getHiveServiceUrlByLang(webcast);

Expand All @@ -89,15 +81,9 @@ class BitmovinController {
parser.href = hls;
offsetPrefix = (parser.search) ? '&' : '?';
hls += `${offsetPrefix}start=${offset}`;

if (angular.isDefined(dash) && dash) {
parser.href = dash;
offsetPrefix = (parser.search) ? '&' : '?';
dash += `${offsetPrefix}start=${offset}`;
}
}
}
return {dash, hls, title, hiveServiceUrl};
return {hls, title, hiveServiceUrl};
}

public getHiveServiceUrlByLang(webcast: any): string {
Expand Down
12 changes: 0 additions & 12 deletions test/bitdash-controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,19 @@ describe('BitdashController', () => {
streamName: 'myStream'
},
playout: {
dashDvrUrl: 'https://dashdvr-origin.edge-cdn.net/webcast/myStreamDvr/playlist.m3u8?DVR',
dashUrl: 'https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd',
hlsDvrUrl: 'https://hlsdvr-origin.edge-cdn.net/webcast/myStreamDvr/playlist.m3u8?DVR',
hlsUrl: 'https://live-origin.edge-cdn.net/webcast/myStream/master.m3u8'
}
},
name: 'Webcast Excample (3)',
postliveStateData: {
playout: {
dashUrl: 'https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd',
hlsUrl: 'http://hd2.cdn.edge-cdn.net/i/videodb/519/videodb_519_76439_7579412_16x9_hd.mp4/master.m3u8',
offset: 0
}
},
preliveStateData: {
playout: {
dashUrl: 'https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd',
hlsUrl: 'http://hd2.cdn.edge-cdn.net/i/videodb/519/videodb_519_53393_7971020_16x9_hq.mp4/master.m3u8'
}
},
Expand Down Expand Up @@ -114,7 +110,6 @@ describe('BitdashController', () => {
vm.$onInit();
expect(vm.config.source.hls).toBe('http://hd2.cdn.edge-cdn.net/i/videodb/519/' +
'videodb_519_76439_7579412_16x9_hd.mp4/master.m3u8');
expect(vm.config.source.dash).toBe('https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd');
});

it('should configure the player with vmpro HLS URL', () => {
Expand All @@ -132,18 +127,15 @@ describe('BitdashController', () => {
expect(vm.config.source.hls).toBe(
'http://hd2.cdn.edge-cdn.net/i/videodb/519/videodb_519_76439_7579412_16x9_hd.mp4/master.m3u8?start=10'
);
expect(vm.config.source.dash).toBe('https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd?start=10');
});

it('should configure the player with offset and existing query string', () => {
$scope.webcast.postliveStateData.playout.offset = 10;
$scope.webcast.postliveStateData.playout.hlsUrl += '?sth';
$scope.webcast.postliveStateData.playout.dashUrl += '?sth';
const vm = new createController();
vm.$onInit();
expect(vm.config.source.hls).toBe('http://hd2.cdn.edge-cdn.net/i/videodb/519/' +
'videodb_519_76439_7579412_16x9_hd.mp4/master.m3u8?sth&start=10');
expect(vm.config.source.dash).toBe('https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd?sth&start=10');
});

it('should configure the player in DVR with offset', () => {
Expand All @@ -154,17 +146,13 @@ describe('BitdashController', () => {
expect(vm.config.source.hls).toBe(
'https://hlsdvr-origin.edge-cdn.net/webcast/myStreamDvr/playlist.m3u8?DVR&wowzadvrplayliststart=10000'
);
expect(vm.config.source.dash).toBe(
'https://dashdvr-origin.edge-cdn.net/webcast/myStreamDvr/playlist.m3u8?DVR&wowzadvrplayliststart=10000'
);
});

it('should configure the player with forced live state', () => {
$scope.options = {forcedState: 'live'};
const vm = new createController();
vm.$onInit();
expect(vm.config.source.hls).toBe('https://live-origin.edge-cdn.net/webcast/myStream/master.m3u8');
expect(vm.config.source.dash).toBe('https://live-origin.edge-cdn.net/webcast/myStream/manifest.mpd');
});

});