Skip to content

Commit

Permalink
Merge pull request #730 from kwarismian/api-vgmaster
Browse files Browse the repository at this point in the history
fix(vgAPI): Fix syntax error in getMasterMedia and isMasterDefined
  • Loading branch information
Elecash authored Jun 14, 2018
2 parents 5a77e85 + 7bde808 commit 985c085
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/services/vg-api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ describe('Videogular Player', () => {
it('Should get the master media', () => {
api.medias = {
main: {id: 'main'},
secondary: {id: 'secondary', vgMedia: true}
secondary: {id: 'secondary', vgMaster: true}
};

expect(api.getMasterMedia()).toEqual({id: 'secondary', vgMedia: true});
expect(api.getMasterMedia()).toEqual({id: 'secondary', vgMaster: true});
});
it('Should get the default media when no master is defined', () => {
api.medias = {
Expand Down
4 changes: 2 additions & 2 deletions src/core/services/vg-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class VgAPI {
getMasterMedia():IPlayable {
let master:any;
for (let id in this.medias) {
if (this.medias[id].vgMedia === 'true' || this.medias[id].vgMedia === true) {
if (this.medias[id].vgMaster === 'true' || this.medias[id].vgMaster === true) {
master = this.medias[id];
break;
}
Expand All @@ -43,7 +43,7 @@ export class VgAPI {
isMasterDefined():boolean {
let result = false;
for (let id in this.medias) {
if (this.medias[id].vgMedia === 'true' || this.medias[id].vgMedia === true) {
if (this.medias[id].vgMaster === 'true' || this.medias[id].vgMaster === true) {
result = true;
break;
}
Expand Down

0 comments on commit 985c085

Please sign in to comment.