mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
improve
This commit is contained in:
@@ -15,6 +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"
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -41,6 +42,8 @@ export class ViewPublicationsPage implements OnInit {
|
||||
|
||||
swiperModules = [IonicSlides];
|
||||
@ViewChild('myVideo') myVideo: any;
|
||||
@ViewChild('VideoManager') VideoManager;
|
||||
|
||||
public lastScrollTop = 0;
|
||||
public isHidden = false;
|
||||
|
||||
@@ -53,11 +56,28 @@ export class ViewPublicationsPage implements OnInit {
|
||||
public p: PermissionService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
public publicationFolderService: PublicationFolderService,
|
||||
public checkFileType: checkFileTypeService
|
||||
public checkFileType: checkFileTypeService,
|
||||
private publicationVideoManagerService: PublicationVideoManagerService
|
||||
) {
|
||||
|
||||
setTimeout(()=> {
|
||||
// console.log("this.VideoManager", this.VideoManager, document.querySelector('.VideoManager'))
|
||||
this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement)
|
||||
}, 2000)
|
||||
|
||||
// this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement)
|
||||
this.createPublicationList()
|
||||
|
||||
}
|
||||
|
||||
|
||||
onVisibilityChange = (e: boolean) => {
|
||||
|
||||
console.log("nice to have", e)
|
||||
if(!e) {
|
||||
this.stopVideo()
|
||||
}
|
||||
}
|
||||
ngOnInit() {
|
||||
if (typeof (this.folderId) == 'object') {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
@@ -92,6 +112,9 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.getPublicationsIds();
|
||||
|
||||
|
||||
this.stopVideo();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -298,15 +321,19 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
stopVideo() {
|
||||
this.myVideo.nativeElement.pause();
|
||||
this.myVideo.nativeElement.currentTime = 0;
|
||||
var videos = document.querySelectorAll('video');
|
||||
|
||||
// Pause each video
|
||||
videos.forEach(function (video) {
|
||||
video.pause();
|
||||
})
|
||||
}
|
||||
|
||||
public onScroll(event): void {
|
||||
if(this.lastScrollTop < event.detail.scrollTop) {
|
||||
console.log("scrolling down")
|
||||
// console.log("scrolling down")
|
||||
} else {
|
||||
console.log("scrolling up")
|
||||
// console.log("scrolling up")
|
||||
}
|
||||
|
||||
this.lastScrollTop = event.detail.scrollTop;
|
||||
|
||||
Reference in New Issue
Block a user