-
Notifications
You must be signed in to change notification settings - Fork 1
/
2850.df09a9e965b56d4a.js
1 lines (1 loc) · 7.42 KB
/
2850.df09a9e965b56d4a.js
1
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2850],{2850:(b,g,l)=>{l.r(g),l.d(g,{ReelsPageModule:()=>v});var a=l(177),u=l(9417),s=l(915),c=l(1470),h=l(5694),e=l(4438),f=l(6863),m=l(8879);const p=["instagramVideo"];function P(i,d){1&i&&e.nrm(0,"ion-icon",25)}function y(i,d){1&i&&e.nrm(0,"ion-icon",26)}function w(i,d){if(1&i){const n=e.RV6();e.j41(0,"div",7)(1,"video",8,0),e.bIt("click",function(){e.eBV(n);const o=e.XpG();return e.Njj(o.changeVideoVolume())}),e.nrm(3,"source",9),e.k0s(),e.j41(4,"div",10)(5,"ion-button",11),e.bIt("click",function(){const o=e.eBV(n).$implicit,r=e.XpG();return e.Njj(r.likeReel(o))}),e.DNE(6,P,1,0,"ion-icon",12)(7,y,1,0,"ion-icon",13),e.k0s(),e.j41(8,"strong",14),e.EFF(9),e.k0s(),e.j41(10,"ion-button",15),e.nrm(11,"ion-icon",16),e.k0s(),e.j41(12,"ion-button",15),e.nrm(13,"ion-icon",17),e.k0s(),e.j41(14,"ion-button",18),e.nrm(15,"ion-icon",19),e.k0s()(),e.j41(16,"div",20)(17,"div",21),e.nrm(18,"img",22),e.j41(19,"h3"),e.EFF(20),e.j41(21,"button",23),e.EFF(22),e.nI1(23,"translate"),e.k0s()()(),e.j41(24,"div",24)(25,"p"),e.EFF(26),e.k0s()()()()}if(2&i){const n=d.$implicit,t=e.XpG();e.xc7("height",t.pageHeight-51,"px"),e.R7$(),e.xc7("height",t.pageHeight-51,"px"),e.Y8G("muted",t.muteStatus),e.R7$(2),e.Mz_("src","",null==n?null:n.src,"#t=0.1",e.B4B),e.R7$(3),e.Y8G("ngIf",1!=(null==n?null:n.liked)),e.R7$(),e.Y8G("ngIf",1==(null==n?null:n.liked)),e.R7$(2),e.SpI(" ",t.commonFunctions.nFormatter(n.likes,1),""),e.R7$(8),e.Y8G("routerLink","/p/profile/"+(null==n?null:n.userid)),e.R7$(),e.Y8G("src",null==n?null:n.profile_picture,e.B4B),e.R7$(2),e.SpI(" ",null==n?null:n.username," "),e.R7$(2),e.JRh(e.bMT(23,15,"Follow")),e.R7$(4),e.JRh(null==n?null:n.description)}}const _=[{path:"",component:(()=>{class i{constructor(n,t,o){this.dataManager=n,this.commonFunctions=t,this.changeDetectorRef=o,this.pageHeight=window.innerHeight,this.nowPlaying=null,this.muteStatus=!0,this.startIndex=0,this.endIndex=5}ngOnInit(){}ngAfterViewInit(){this.videos.changes.subscribe(n=>{this.videos=n,this.didScroll()})}loadData(){this.endIndex=this.reels.length>this.endIndex+5?this.endIndex+5:this.endIndex+(this.reels.length-this.endIndex)}ionViewDidEnter(){this.changeDetectorRef.detectChanges(),null==this.nowPlaying?this.dataManager.getReels(n=>{this.commonFunctions.getRandomElements(n,-1,t=>{this.reels=t})}):this.nowPlaying.play()}ionViewWillLeave(){this.changeDetectorRef.detach(),null!=this.nowPlaying&&this.nowPlaying.pause()}isElementInViewport(n){const t=n.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}didScroll(){this.nowPlaying&&this.isElementInViewport(this.nowPlaying)||(this.nowPlaying&&!this.isElementInViewport(this.nowPlaying)&&(this.reels[this.endIndex-2].src+"#t=0.1"==this.nowPlaying.querySelector("source").src&&this.loadData(),this.nowPlaying.pause(),this.nowPlaying=null),this.videos.forEach(n=>{if(this.nowPlaying)return;const t=n.nativeElement;this.isElementInViewport(t)&&(this.nowPlaying=t,this.nowPlaying.play())}))}likeReel(n){1!=n.liked?(n.likes+=1,n.liked=!0):(n.likes-=1,n.liked=!1)}changeVideoVolume(){this.nowPlaying.muted?(this.nowPlaying.muted=!1,this.muteStatus=!1):(this.nowPlaying.muted=!0,this.muteStatus=!0)}doRefresh(n){this.nowPlaying=null,this.ionViewDidEnter(),setTimeout(()=>{n.target.complete()},1e3)}static#e=this.\u0275fac=function(t){return new(t||i)(e.rXU(f.j),e.rXU(m.k),e.rXU(e.gRc))};static#n=this.\u0275cmp=e.VBU({type:i,selectors:[["app-reels"]],viewQuery:function(t,o){if(1&t&&e.GBs(p,5),2&t){let r;e.mGM(r=e.lsd())&&(o.videos=r)}},standalone:!0,features:[e.aNF],decls:10,vars:7,consts:[["instagramVideo",""],["slot","fixed",3,"ionRefresh"],[1,"reel-header"],[1,"reel-title"],["name","camera-outline"],[1,"reels-list",3,"scroll"],["class","reel",3,"height",4,"ngFor","ngForOf"],[1,"reel"],["playsinline","","loop","","preload","metadata",3,"click","muted"],["type","video/mp4",3,"src"],["lines","none",1,"controllers"],["slot","start","fill","clear",1,"iconsStart","controller",3,"click"],["slot","icon-only","name","heart-outline",4,"ngIf"],["slot","icon-only","name","heart","color","danger",4,"ngIf"],[1,"controllerNumber"],["slot","start","fill","clear",1,"iconsStart","controller"],["slot","icon-only","name","chatbubble-outline"],["slot","icon-only","name","paper-plane-outline"],["slot","end","fill","clear",1,"iconsStart","controller"],["slot","icon-only","name","bookmark-outline"],[1,"reel-footer"],[1,"user-info",3,"routerLink"],["alt","",1,"user-avatar",3,"src"],[1,"follow-button"],[1,"reel-description"],["slot","icon-only","name","heart-outline"],["slot","icon-only","name","heart","color","danger"]],template:function(t,o){1&t&&(e.j41(0,"ion-content")(1,"ion-refresher",1),e.bIt("ionRefresh",function(x){return o.doRefresh(x)}),e.nrm(2,"ion-refresher-content"),e.k0s(),e.j41(3,"div",2)(4,"h3",3),e.EFF(5,"Reels"),e.k0s(),e.nrm(6,"ion-icon",4),e.k0s(),e.j41(7,"ion-list",5),e.bIt("scroll",function(){return o.didScroll()}),e.DNE(8,w,27,17,"div",6),e.nI1(9,"slice"),e.k0s()()),2&t&&(e.R7$(7),e.xc7("height",o.pageHeight-51,"px"),e.R7$(),e.Y8G("ngForOf",e.brH(9,3,o.reels,o.startIndex,o.endIndex)))},dependencies:[s.bv,s.Jm,s.W9,s.iq,s.nf,s.To,s.Ki,s.N7,a.pM,a.bT,c.Wk,a.P9,h.h,h.D9],styles:["ion-icon[_ngcontent-%COMP%], .reel-title[_ngcontent-%COMP%]{color:#fff!important}.reels-list[_ngcontent-%COMP%]{display:grid;grid-column:auto;position:absolute;background-color:#fff;overflow-x:hidden;width:100%;padding:0;scroll-snap-type:y mandatory;scroll-behavior:smooth}.reel[_ngcontent-%COMP%]{position:relative;width:100%;background-color:#fff;scroll-snap-align:start}.reel-header[_ngcontent-%COMP%]{position:absolute;z-index:10;width:100%;display:flex;justify-content:space-between;align-items:center}.reel-header[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{padding:5px 10px}.reel-header[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{zoom:1.7}.reel-header[_ngcontent-%COMP%] .reel-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;font-family:sans-serif}.reel-footer[_ngcontent-%COMP%]{position:absolute;bottom:0;display:grid;align-items:center;margin-left:14px}.user-info[_ngcontent-%COMP%]{color:#fff;display:flex;align-items:center}.reel-description[_ngcontent-%COMP%]{color:#fff}.reel-description[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:10px 0;font-size:14px}.user-avatar[_ngcontent-%COMP%]{border-radius:50%;width:35px;height:35px}.user-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:15px;margin-left:10px}.user-info[_ngcontent-%COMP%] .follow-button[_ngcontent-%COMP%]{color:#fff;font-weight:900;text-transform:inherit;background:transparent;border:1px solid white;padding:5px;border-radius:5px;margin-left:10px}.controllers[_ngcontent-%COMP%]{position:absolute;bottom:25px;right:0;display:grid;width:60px}.controller[_ngcontent-%COMP%]{margin:2px}.controllerNumber[_ngcontent-%COMP%]{margin:auto;color:#fff}video[_ngcontent-%COMP%]{width:99.9%;margin:auto;height:-webkit-fill-available;object-fit:cover}ion-button[_ngcontent-%COMP%] .button-inner[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}"]})}return i})()}];let R=(()=>{class i{static#e=this.\u0275fac=function(t){return new(t||i)};static#n=this.\u0275mod=e.$C({type:i});static#t=this.\u0275inj=e.G2t({imports:[c.iI.forChild(_),c.iI]})}return i})(),v=(()=>{class i{static#e=this.\u0275fac=function(t){return new(t||i)};static#n=this.\u0275mod=e.$C({type:i});static#t=this.\u0275inj=e.G2t({imports:[a.MD,u.YN,s.bv,R]})}return i})()}}]);