diff --git a/package-lock.json b/package-lock.json index 92f30ad3..f3ba5842 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,7 @@ "get-youtube-id": "^1.0.1", "ionicons": "^7.0.0", "jquery": "^3.7.1", + "jsqr": "^1.4.0", "plyr": "^3.7.8", "reflect-metadata": "^0.1.13", "rxjs": "~7.8.0", @@ -12818,6 +12819,11 @@ "node": "*" } }, + "node_modules/jsqr": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jsqr/-/jsqr-1.4.0.tgz", + "integrity": "sha512-dxLob7q65Xg2DvstYkRpkYtmKm2sPJ9oFhrhmudT1dZvNFFTlroai3AWSpLey/w5vMcLBXRgOJsbXpdN9HzU/A==" + }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 99f5ebea..ea805513 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -41,8 +41,6 @@ export class AppComponent implements OnInit { case 'VERSION_DETECTED': console.log(`Downloading new app version: ${evt.version.hash}`); this.presentUpdateAlert(); - // if (confirm('A new version is available. Load it?')) - // window.location.reload(); break; case 'VERSION_READY': console.log(`Current app version: ${evt.currentVersion.hash}`); diff --git a/src/app/app.module.ts b/src/app/app.module.ts index a879dd85..d35700be 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -108,11 +108,20 @@ export function initializeFactory(init: DbService) { }) export class AppModule { - constructor(private translate: TranslateService) { - this.setDefaultLanguage(); - } + constructor(private translate: TranslateService, private storage: StorageService) { + this.storage.getData('lang').then(lang =>{ + console.log(lang); + if(!lang) + { + this.setDefaultLanguage(); + } + }); + +} + private setDefaultLanguage() { + this.storage.setData('lang', 'hi'); this.translate.setDefaultLang('hi'); this.translate.use("hi"); } diff --git a/src/app/components/application-header/application-header.component.html b/src/app/components/application-header/application-header.component.html index 75c7ea77..9367042e 100644 --- a/src/app/components/application-header/application-header.component.html +++ b/src/app/components/application-header/application-header.component.html @@ -11,15 +11,16 @@ {{ configVariables.siteName }} + *ngIf="!(headerConfig?.showbackButton && (headerConfig?.actionButtons?.indexOf('search') >=0 || headerConfig?.actionButtons?.indexOf('edit') >=0))">{{ configVariables.siteName }} + {{ headerConfig.pageTitle }} - + diff --git a/src/app/components/bot-messages/bot-messages.component.html b/src/app/components/bot-messages/bot-messages.component.html index b4813655..3b9448d0 100644 --- a/src/app/components/bot-messages/bot-messages.component.html +++ b/src/app/components/bot-messages/bot-messages.component.html @@ -30,19 +30,20 @@
- - + [disabled]="disabled" + aria-label="" + value="" + [placeholder]="'Type here' | translate" + (keyup.enter)="handleMessage()" + fill="outline" + shape="round" + [(ngModel)]="textMessage" + #textareaField + (ionFocus)="onInputFocus()" + (ionBlur)="onInputBlur()"> +
{{durationDisplay}} diff --git a/src/app/components/bot-messages/bot-messages.component.scss b/src/app/components/bot-messages/bot-messages.component.scss index ea5d332b..9bbe2651 100644 --- a/src/app/components/bot-messages/bot-messages.component.scss +++ b/src/app/components/bot-messages/bot-messages.component.scss @@ -49,7 +49,7 @@ ion-content{ box-shadow: 0px -0.33px 0px 0px #A6A6AA; display: flex; align-items: center; - ion-input { + ion-textarea { width: 90%; } ion-button { diff --git a/src/app/components/qrcode-popup/qrcode-popup.component.ts b/src/app/components/qrcode-popup/qrcode-popup.component.ts index e6b8200e..dafd7ec7 100644 --- a/src/app/components/qrcode-popup/qrcode-popup.component.ts +++ b/src/app/components/qrcode-popup/qrcode-popup.component.ts @@ -89,10 +89,6 @@ export class QrcodePopupComponent implements OnInit { this.scanResult = null; } - stopScan() { - this.scanActive = false; - } - async startScan() { // Not working on iOS standalone mode! const stream = await navigator.mediaDevices.getUserMedia({ @@ -109,6 +105,21 @@ export class QrcodePopupComponent implements OnInit { this.videoElement.play(); requestAnimationFrame(this.scan.bind(this)); } + + stopScan() { + this.scanActive = false; + + const stream = this.videoElement.srcObject; + if (stream) { + const tracks = stream.getTracks(); + tracks.forEach(function(track: MediaStreamTrack) { + track.stop(); + console.log('Track stopped:', track.readyState); + + }); + this.videoElement.srcObject = null; + } + } async scan() { try { @@ -140,9 +151,10 @@ export class QrcodePopupComponent implements OnInit { inversionAttempts: 'dontInvert' }); - if (code) { + if (code?.data) { this.scanActive = false; this.scanResult = code.data; + this.stopScan(); this.showQrToast(); } else { if (this.scanActive) { diff --git a/src/app/pages/create-playlist/create-playlist.page.ts b/src/app/pages/create-playlist/create-playlist.page.ts index 2d1cf0da..f5104428 100644 --- a/src/app/pages/create-playlist/create-playlist.page.ts +++ b/src/app/pages/create-playlist/create-playlist.page.ts @@ -174,7 +174,8 @@ export class CreatePlaylistPage implements OnInit { this.selectedContents.forEach((ele) => { if (!ele.metaData['thumbnail']) { if (ele.metaData.mimetype === PlayerType.YOUTUBE) { - ele.metaData['thumbnail'] = this.loadYoutubeImg(ele.metaData); + // ele.metaData['thumbnail'] = this.loadYoutubeImg(ele.metaData); + ele.metaData['thumbnail'] = ele.metaData.thumbnail; } else { ele.metaData['thumbnail'] = (ele.metaData.thumbnail && !ele.metaData.identifier.startsWith('do_')) ? ele.metaData.thumbnail : ContentUtil.getImagePath(ele.metaData.mimetype || ele.metaData.mimeType) } diff --git a/src/app/pages/home/home.page.ts b/src/app/pages/home/home.page.ts index 50da747e..8fe79603 100644 --- a/src/app/pages/home/home.page.ts +++ b/src/app/pages/home/home.page.ts @@ -50,6 +50,7 @@ export class HomePage implements OnInit, OnTabViewWillEnter, OnDestroy { selectedLang: any = ""; appName: string = ""; configVariables = ConfigVariables; + responseList: Array = []; constructor( private headerService: AppHeaderService, private router: Router, @@ -115,6 +116,7 @@ export class HomePage implements OnInit, OnTabViewWillEnter, OnDestroy { if(val == 'language') { let lang = await this.storage.getData('lang'); console.log('lang ', lang, this.selectedLang); + this.responseList = await this.searchService.postContentSearch(req, await this.storage.getData('lang')); if (this.selectedLang !== lang) { this.selectedLang = lang; this.showSheenAnimation = true; @@ -143,7 +145,7 @@ export class HomePage implements OnInit, OnTabViewWillEnter, OnDestroy { this.serverError = false; this.showSheenAnimation = true; // try { - let lang = 'en';//await this.storage.getData('lang') + let lang = await this.storage.getData('lang') let content = await this.configService.getAllContent(req, lang); this.mappUIContentList(content); // } @@ -163,9 +165,11 @@ export class HomePage implements OnInit, OnTabViewWillEnter, OnDestroy { console.log(val); this.showSheenAnimation = true; try { - let res: any = await this.searchService.postContentSearch(req, await this.storage.getData('lang')); - console.log('Response', res); - this.mappUIContentList(res); + this.responseList = []; + this.responseList = await this.searchService.postContentSearch(req, await this.storage.getData('lang')); + // let res: any = await this.searchService.postContentSearch(req, await this.storage.getData('lang')); + console.log('Response', this.responseList); + this.mappUIContentList(this.responseList); } catch (e) { console.log('error', e); @@ -173,6 +177,7 @@ export class HomePage implements OnInit, OnTabViewWillEnter, OnDestroy { }) this.networkConnected = await this.networkService.getNetworkStatus() let forceRefresh = await this.cacheService.getCacheTimeout(); + let lang = await this.storage.getData('lang'); if (forceRefresh) { this.getServerMetaConfig(); } else if (!this.networkConnected) { diff --git a/src/app/pages/mypitara/mypitara.page.ts b/src/app/pages/mypitara/mypitara.page.ts index 6ca46878..3b982635 100644 --- a/src/app/pages/mypitara/mypitara.page.ts +++ b/src/app/pages/mypitara/mypitara.page.ts @@ -62,15 +62,23 @@ export class MyPitaraPage implements OnTabViewWillEnter{ async getRecentlyviewedContent() { await this.contentService.getRecentlyViewedContent('guest').then((result) => { - this.contentList = result; - this.contentList.forEach((ele: any) => { - if (ele.metaData.mimetype === PlayerType.YOUTUBE) { - ele.metaData['thumbnail'] = this.loadYoutubeImg(ele.metaData) - } else { - ele.metaData['thumbnail'] = (ele.metaData.thumbnail && !ele?.metaData.identifier?.startsWith('do_')) ? ele.metaData.thumbnail : ContentUtil.getImagePath(ele.metaData.mimeType || ele.metaData.mimetype) + this.contentList = []; + let uniqueIds: any = {}; + result.filter((item : any) => { + if (!uniqueIds[item.contentIdentifier]) { + uniqueIds[item.contentIdentifier] = true; + this.contentList.push(item); + if (item.metaData.mimetype === PlayerType.YOUTUBE) { + // item.metaData['thumbnail'] = this.loadYoutubeImg(item.metaData) + item.metaData['thumbnail'] = item.metaData.thumbnail; + + } else { + item.metaData['thumbnail'] = (item.metaData.thumbnail && !item?.metaData.identifier?.startsWith('do_')) ? item.metaData.thumbnail : ContentUtil.getImagePath(item.metaData.mimeType || item.metaData.mimetype) + } + return true; } - }) - console.log('contentList', this.contentList); + return false; + }); }).catch((err) => { console.log('error', err) }) diff --git a/src/app/pages/playlist-details/playlist-details.page.html b/src/app/pages/playlist-details/playlist-details.page.html index c296e17f..ae367851 100644 --- a/src/app/pages/playlist-details/playlist-details.page.html +++ b/src/app/pages/playlist-details/playlist-details.page.html @@ -5,12 +5,22 @@
- + + + + + + + + + + + + + + + + -