-
Notifications
You must be signed in to change notification settings - Fork 1
/
2850.8080f46945baba93.js
1 lines (1 loc) · 7.97 KB
/
2850.8080f46945baba93.js
1
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[2850],{2850:(M,g,l)=>{l.r(g),l.d(g,{ReelsPageModule:()=>R});var a=l(177),u=l(9417),s=l(375),c=l(1470),h=l(7408),n=l(4438),f=l(6863),m=l(8879);const p=["instagramVideo"];function P(i,d){1&i&&n.nrm(0,"ion-icon",27)}function y(i,d){1&i&&n.nrm(0,"ion-icon",28)}function w(i,d){if(1&i){const e=n.RV6();n.j41(0,"div",7)(1,"video",8,0),n.bIt("click",function(){n.eBV(e);const o=n.XpG();return n.Njj(o.changeVideoVolume())}),n.nrm(3,"source",9),n.k0s(),n.j41(4,"div",10)(5,"ion-button",11),n.bIt("click",function(){const o=n.eBV(e).$implicit,r=n.XpG();return n.Njj(r.likeReel(o))}),n.DNE(6,P,1,0,"ion-icon",12)(7,y,1,0,"ion-icon",13),n.k0s(),n.j41(8,"ion-text",14),n.EFF(9),n.k0s(),n.j41(10,"ion-button",15),n.nrm(11,"ion-icon",16),n.k0s(),n.j41(12,"ion-button",15),n.nrm(13,"ion-icon",17),n.k0s(),n.j41(14,"ion-button",18),n.nrm(15,"ion-icon",19),n.k0s()(),n.j41(16,"div",20)(17,"div",21),n.nrm(18,"img",22),n.j41(19,"h3"),n.EFF(20),n.j41(21,"button",23),n.EFF(22),n.nI1(23,"translate"),n.k0s()()(),n.j41(24,"div",24),n.nrm(25,"ion-icon",25),n.j41(26,"p"),n.EFF(27),n.nI1(28,"translate"),n.k0s()(),n.j41(29,"div",26)(30,"p"),n.EFF(31),n.k0s()()()()}if(2&i){const e=d.$implicit,t=n.XpG();n.xc7("height",t.pageHeight-51,"px"),n.R7$(),n.xc7("height",t.pageHeight-51,"px"),n.Y8G("muted",t.muteStatus),n.R7$(2),n.Mz_("src","",null==e?null:e.src,"#t=0.1",n.B4B),n.R7$(3),n.Y8G("ngIf",1!=(null==e?null:e.liked)),n.R7$(),n.Y8G("ngIf",1==(null==e?null:e.liked)),n.R7$(2),n.SpI(" ",t.commonFunctions.nFormatter(e.likes,1),""),n.R7$(8),n.Y8G("routerLink","/p/profile/"+(null==e?null:e.userid)),n.R7$(),n.Y8G("src",null==e?null:e.profile_picture,n.B4B),n.R7$(2),n.SpI(" ",null==e?null:e.username," "),n.R7$(2),n.JRh(n.bMT(23,17,"Follow")),n.R7$(5),n.Lme("",null==e?null:e.username," \u2022 ",n.bMT(28,19,"Original audio"),""),n.R7$(4),n.JRh(null==e?null:e.description)}}const x=[{path:"",component:(()=>{class i{constructor(e,t,o){this.dataManager=e,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(e=>{this.videos=e,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(e=>{this.commonFunctions.getRandomElements(e,-1,t=>{this.reels=t})}):this.nowPlaying.play()}ionViewWillLeave(){this.changeDetectorRef.detach(),null!=this.nowPlaying&&this.nowPlaying.pause()}isElementInViewport(e){const t=e.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(e=>{if(this.nowPlaying)return;const t=e.nativeElement;this.isElementInViewport(t)&&(this.nowPlaying=t,this.nowPlaying.play())}))}likeReel(e){1!=e.liked?(e.likes+=1,e.liked=!0):(e.likes-=1,e.liked=!1)}changeVideoVolume(){this.nowPlaying.muted?(this.nowPlaying.muted=!1,this.muteStatus=!1):(this.nowPlaying.muted=!0,this.muteStatus=!0)}doRefresh(e){this.nowPlaying=null,this.ionViewDidEnter(),setTimeout(()=>{e.target.complete()},1e3)}static{this.\u0275fac=function(t){return new(t||i)(n.rXU(f.j),n.rXU(m.k),n.rXU(n.gRc))}}static{this.\u0275cmp=n.VBU({type:i,selectors:[["app-reels"]],viewQuery:function(t,o){if(1&t&&n.GBs(p,5),2&t){let r;n.mGM(r=n.lsd())&&(o.videos=r)}},standalone:!0,features:[n.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,"audio-info"],["slot","icon-only","name","musical-notes"],[1,"reel-description"],["slot","icon-only","name","heart-outline"],["slot","icon-only","name","heart","color","danger"]],template:function(t,o){1&t&&(n.j41(0,"ion-content")(1,"ion-refresher",1),n.bIt("ionRefresh",function(v){return o.doRefresh(v)}),n.nrm(2,"ion-refresher-content"),n.k0s(),n.j41(3,"div",2)(4,"h3",3),n.EFF(5,"Reels"),n.k0s(),n.nrm(6,"ion-icon",4),n.k0s(),n.j41(7,"ion-list",5),n.bIt("scroll",function(){return o.didScroll()}),n.DNE(8,w,32,21,"div",6),n.nI1(9,"slice"),n.k0s()()),2&t&&(n.R7$(7),n.xc7("height",o.pageHeight-51,"px"),n.R7$(),n.Y8G("ngForOf",n.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.IO,s.N7,a.pM,a.bT,c.Wk,a.P9,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}.audio-info[_ngcontent-%COMP%]{display:flex;gap:5px}.audio-info[_ngcontent-%COMP%] *[_ngcontent-%COMP%]{font-size:11px}.audio-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;color:#fff}.user-avatar[_ngcontent-%COMP%]{border-radius:50%;width:30px;height:30px}.user-info[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-size:14px;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:7px;margin-left:10px}.controllers[_ngcontent-%COMP%]{position:absolute;bottom:25px;right:0;display:grid;width:60px}.controllers[_ngcontent-%COMP%] ion-icon[_ngcontent-%COMP%]{font-size:1.4rem;--ionicon-stroke-width: 45px}.controller[_ngcontent-%COMP%]{margin:2px}.controllerNumber[_ngcontent-%COMP%]{margin:auto;color:#fff;font-size:14px;font-weight:700}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 _=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=n.$C({type:i})}static{this.\u0275inj=n.G2t({imports:[c.iI.forChild(x),c.iI]})}}return i})(),R=(()=>{class i{static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275mod=n.$C({type:i})}static{this.\u0275inj=n.G2t({imports:[a.MD,u.YN,s.bv,_]})}}return i})()}}]);