Skip to content

Commit

Permalink
Issue #ED-0000 merge: Merge pull request #3624 from Ajoymaity/release…
Browse files Browse the repository at this point in the history
…-8.0.0-v16

Issue #ED-0000 fix: Fixed player issue
  • Loading branch information
swayangjit authored May 23, 2024
2 parents 28b987a + b9e245a commit 57f6123
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 127 deletions.
131 changes: 30 additions & 101 deletions package-lock.json

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

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@
"@project-sunbird/sb-notification": "^8.0.0",
"@project-sunbird/sb-styles": "0.0.16",
"@project-sunbird/sb-svg2pdf": "^8.0.3",
"@project-sunbird/sunbird-epub-player-v9": "^5.6.0",
"@project-sunbird/sunbird-epub-player-web-component": "^1.2.0",
"@project-sunbird/sunbird-pdf-player-v9": "^5.6.0",
"@project-sunbird/sunbird-pdf-player-web-component": "^1.1.0",
"@project-sunbird/sunbird-quml-player-web-component": "3.0.3",
"@project-sunbird/sunbird-sdk": "7.0.23",
Expand All @@ -101,7 +99,7 @@
"jest-preset-angular": "13.1.4",
"jspdf": "^2.5.1",
"jwt-decode": "^2.2.0",
"katex": "^0.11.1",
"katex": "^0.16.10",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"material-design-icons": "^3.0.1",
Expand Down Expand Up @@ -155,7 +153,7 @@
"@babel/preset-typescript": "^7.9.0",
"@ionic/angular-toolkit": "^6.0.0",
"@project-sunbird/sb-themes": "0.0.86",
"@project-sunbird/telemetry-sdk": "0.0.29",
"@project-sunbird/telemetry-sdk": "^1.3.0",
"@types/jest": "^28.0.3",
"@types/lodash": "^4.14.180",
"@types/node": "12.11.5",
Expand Down Expand Up @@ -209,7 +207,7 @@
"cordova-plugin-zip": "^3.1.0",
"cordova-sqlite-storage": "^6.0.0",
"cordova-zip-plugin": "github:Sunbird-Ed/jjdltc-cordova-plugin-zip",
"cordova.plugins.diagnostic": "^5.0.2",
"cordova.plugins.diagnostic": "^7.1.4",
"es6-promise-plugin": "^4.2.2",
"fs-extra": "^8.1.0",
"ionic-plugin-keyboard": "^2.2.1",
Expand Down
4 changes: 0 additions & 4 deletions src/app/player/player.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { IonicModule } from '@ionic/angular';
import { PlayerPage } from './player.page';
import { CanvasPlayerService } from '../../services/canvas-player.service';
import { ScreenOrientation } from '@awesome-cordova-plugins/screen-orientation/ngx';
import { SunbirdPdfPlayerModule } from '@project-sunbird/sunbird-pdf-player-v9';
import { SunbirdEpubPlayerModule } from '@project-sunbird/sunbird-epub-player-v9';



Expand All @@ -26,8 +24,6 @@ const routes: Routes = [
imports: [
CommonModule,
FormsModule,
SunbirdPdfPlayerModule,
SunbirdEpubPlayerModule,
IonicModule,
RouterModule.forChild(routes)
],
Expand Down
12 changes: 6 additions & 6 deletions src/app/player/player.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,29 @@
<quml-main-player [playerConfig]="config" (playerEvent)="playerEvents($event)"
(telemetryEvent)="playerTelemetryEvents($event)"></quml-main-player>
</div> -->
<div *ngIf="playerType === 'sunbird-video-player'" style="height:100vh;width:100%;">
<div class="sb-player-container-ios" *ngIf="platform.is('ios')" (click)="handleNavBackButton();$event.stopPropagation()">
<div style="height:100vh;width:100%;">
<div class="sb-player-container-ios" *ngIf="platform.is('ios') && playerType === 'sunbird-video-player'" (click)="handleNavBackButton();$event.stopPropagation()">
<div class="sb-circle">
<img src="assets/imgs/ic_back.svg" alt="back" aria-label="back" class="sb-arrow-back" role="button">
</div>
</div>
<!-- <sunbird-video-player [player-config]="config" (playerEvent)="playerEvents($event)"
(telemetryEvent)="playerTelemetryEvents($event)"></sunbird-video-player> -->
<div class="aspectratio" data-ratio="16:9" id="help-video-aspect-ratio" #aspectRatio>
<div #video></div>
<div #player></div>
</div>
</div>
<div class="aspectratio" data-ratio="16:9" *ngIf="playerType === 'sunbird-quml-player'" id="help-video-aspect-ratio" #aspectRatio>
<!-- <div class="aspectratio" data-ratio="16:9" *ngIf="playerType === 'sunbird-quml-player'" id="help-video-aspect-ratio" #aspectRatio>
<div #qumlPlayer></div>
</div>
<div class="aspectratio" data-ratio="16:9" *ngIf="playerType === 'sunbird-pdf-player'" id="help-video-aspect-ratio" #aspectRatio>
<div class="aspectratio" data-ratio="16:9" id="help-video-aspect-ratio" #aspectRatio>
<div #pdf></div>
</div>
<div class="aspectratio" data-ratio="16:9" *ngIf="playerType === 'sunbird-epub-player'" id="help-video-aspect-ratio" #aspectRatio>
<div #epub></div>
</div>
</div> -->

</ion-content>

17 changes: 7 additions & 10 deletions src/app/player/player.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
cardData: any;

@ViewChild('preview', { static: false }) previewElement: ElementRef;
@ViewChild('video') video: ElementRef | undefined;
@ViewChild('pdf') pdf!: ElementRef;
@ViewChild('qumlPlayer', { static: false }) qumlPlayer: ElementRef;
@ViewChild('epub') epub: ElementRef;
@ViewChild('player') player: ElementRef;

constructor(
@Inject('COURSE_SERVICE') private courseService: CourseService,
Expand Down Expand Up @@ -755,7 +752,7 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
this.playerTelemetryEvents(event.detail);
});

this.video?.nativeElement.append(videoElement);
this.player?.nativeElement.append(videoElement);
}, 100);
}
}
Expand All @@ -777,7 +774,7 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
epubElement.addEventListener('telemetryEvent', (event) => {
console.log("On telemetryEvent", event);
});
this.epub.nativeElement.append(epubElement);
this.player.nativeElement.append(epubElement);
}, 100);
}

Expand All @@ -798,12 +795,12 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
pdfElement.addEventListener('telemetryEvent', (event: any) => {
this.playerTelemetryEvents(event.detail);
});
this.pdf.nativeElement.append(pdfElement);
this.player.nativeElement.append(pdfElement);
}, 100);
}

async playQumlContent() {
if (this.playerType === 'sunbird-quml-player' && this.config && this.qumlPlayer) {
if (this.playerType === 'sunbird-quml-player' && this.config && this.player) {
const playerConfig: any = {
context: this.config.context,
config: this.config.config,
Expand All @@ -823,8 +820,8 @@ export class PlayerPage implements OnInit, OnDestroy, PlayerActionHandlerDelegat
console.log("On telemetryEvent", event);
});

if (this.qumlPlayer && this.qumlPlayer.nativeElement) {
this.qumlPlayer.nativeElement.append(qumlElement);
if (this.player && this.player.nativeElement) {
this.player.nativeElement.append(qumlElement);
} else {
console.error("qumlPlayer or its native element is not available.");
}
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"allowSyntheticDefaultImports": true,
"compileOnSave": false,
"angularCompilerOptions": {

"enableIvy": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
},
Expand Down

0 comments on commit 57f6123

Please sign in to comment.