mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add try catch to video.foreach and video.pause
This commit is contained in:
@@ -15,7 +15,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
import { AskModalPage } from 'src/app/modals/ask-modal/ask-modal.page';
|
||||
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
|
||||
import { PublicationVideoManagerService } from "src/app/services/publication/publication-video-manager.service";
|
||||
import { PublicationVideoManagerService } from "src/app/services/publication/publication-video-manager.service";
|
||||
import { StopvideoService } from "src/app/services/stopvideo.service";
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -80,7 +80,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
onVisibilityChange = (e: boolean) => {
|
||||
|
||||
console.log("nice to have", e)
|
||||
if(!e) {
|
||||
if (!e) {
|
||||
/* this.stopVideo() */
|
||||
}
|
||||
}
|
||||
@@ -228,13 +228,13 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.publicationFolderService.revertPublicationOrder(folderId)
|
||||
} else {
|
||||
|
||||
let a: any = Object.assign({},this.publicationFolderService.publicationList[folderId][findIndex])
|
||||
let a: any = Object.assign({}, this.publicationFolderService.publicationList[folderId][findIndex])
|
||||
let b: any = Object.assign({}, publicationDetails)
|
||||
|
||||
a.Files = a.Files.length
|
||||
b.Files = b.Files.length
|
||||
|
||||
if(JSON.stringify(a) != JSON.stringify(b)) {
|
||||
if (JSON.stringify(a) != JSON.stringify(b)) {
|
||||
|
||||
// console.log({a, b})
|
||||
this.publicationFolderService.publicationList[folderId][findIndex] = publicationDetails
|
||||
@@ -329,7 +329,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
this.close();
|
||||
this.getActions.emit();
|
||||
|
||||
|
||||
|
||||
}
|
||||
// Do nothing
|
||||
@@ -343,7 +343,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
this.stopVideo();
|
||||
|
||||
setTimeout(()=> {
|
||||
setTimeout(() => {
|
||||
this.openPublicationDetails.emit({ DocumentId, ProcessId });
|
||||
}, 200)
|
||||
|
||||
@@ -370,30 +370,35 @@ export class ViewPublicationsPage implements OnInit {
|
||||
stopVideo() {
|
||||
var videos = document.querySelectorAll('video');
|
||||
|
||||
// Pause each video
|
||||
videos.forEach(function (video) {
|
||||
video.pause();
|
||||
})
|
||||
try {
|
||||
// Pause each video
|
||||
videos.forEach(function (video) {
|
||||
video.pause();
|
||||
})
|
||||
|
||||
|
||||
this.videoElements.forEach(videoElement => {
|
||||
// You can access the native HTML video element using videoElement.nativeElement
|
||||
const video: HTMLVideoElement = videoElement.nativeElement;
|
||||
this.videoElements.forEach(videoElement => {
|
||||
// You can access the native HTML video element using videoElement.nativeElement
|
||||
const video: HTMLVideoElement = videoElement.nativeElement;
|
||||
|
||||
video.pause()
|
||||
// Do something with each video element
|
||||
// console.log(video);
|
||||
});
|
||||
video.pause()
|
||||
// Do something with each video element
|
||||
// console.log(video);
|
||||
});
|
||||
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
|
||||
public onScroll(event): void {
|
||||
if(this.lastScrollTop < event.detail.scrollTop) {
|
||||
if (this.lastScrollTop < event.detail.scrollTop) {
|
||||
// console.log("scrolling down")
|
||||
} else {
|
||||
} else {
|
||||
// console.log("scrolling up")
|
||||
}
|
||||
}
|
||||
|
||||
this.lastScrollTop = event.detail.scrollTop;
|
||||
this.lastScrollTop = event.detail.scrollTop;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user