const{createApp}=Vue const{createVuetify,useGoTo,useDisplay}=Vuetify var data={alert:{show:false,color:'success',text:'',timeout:0,},theme:{dark:false,},nav:{showDrawer:false,showTOC:true,tocPanel:0,tab:'account',post:{discussionId:8616,currentPage:1,targetPage:1,total:24,anchor:0,goToOptions:{container:null,duration:0,easing:'easeInOutCubic',offset:-100,},worker:null,task:[],active:[],apiLock:[],originLike:new Map([]),},related:{block:1,}},search:{width:80,text:null,loading:false,},tags:[],posts:[{id:115475,num:0,uid:18868,content:'',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 09:33:19',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115476,num:1,uid:15338,content:'哈哈哈,得回到 emby 或者 jellyfin',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 09:48:19',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115477,num:2,uid:528,content:'那可太多了,服务端部署 Plex/Emby/Jellyfin ,客户端使用 网页端、各家官方 App 或 Infuse/VidHub 等等等等。\u003Cbr\u003E\u003Cbr\u003E卡住应该是在走软解吧,如果是这样,你后面用网页依旧还是会卡的。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 09:50:16',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115478,num:3,uid:584,content:'设备性能好嘛?会不会是转码不行啊。 那样的话走设备硬解',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:03:15',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115479,num:4,uid:13449,content:'emby 吧,飞牛其实还是要时间的,要求不要太高。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:06:19',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115480,num:5,uid:13507,content:'网页你得选原画,不然就是调用飞牛的硬件解码,有显卡的话就是飞牛硬解,没有就是飞牛 cpu 软解。卡住就是因为软解没跟上',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 10:21:54',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115481,num:6,uid:18468,content:'经常卡住可能是在视频在浏览器下不能原画播放,然后自动切换到转码播放了,转码对性能,转码参数优化都有很高的要求,这块建议使用成熟的来体验吧',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:37:46',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115482,num:7,uid:446,content:'![]( \u003Cimg src\u003D\"https://i.imgur.com/0HUfcbS.png\"\u003E)\u003Cbr\u003E\u003Cbr\u003E孩子们\u003Cbr\u003E有人叫我',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:40:24',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115483,num:8,uid:18796,content:'如果飞牛影视都能卡,那么你换其他的比如 jeffyfin 、emby 一样卡。\u003Cbr\u003E\u003Cbr\u003E还是看 CPU 和 GPU 性能、还有带宽。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 11:45:14',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115484,num:9,uid:15900,content:'这得看你播放端的解码能力...\u003Cbr\u003E我用的是 Jellyfin..',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:01:38',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115485,num:10,uid:3971,content:'通过 **b 访问文件,让播放设备解码',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:06:47',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115486,num:11,uid:18868,content:'\u003Cbr\u003E![]( https://webwlx.oss-cn-beijing.aliyuncs.com/iShot_2025-04-17_13.12.21.png)\u003Cbr\u003E![]( https://webwlx.oss-cn-beijing.aliyuncs.com/iShot_2025-04-17_13.12.08.png)\u003Cbr\u003E\u003Cbr\u003E播放端是 chrome 浏览器 mac m2pro 性能应该都是够的',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:13:54',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115487,num:12,uid:18868,content:'用了网易爆米花,用 **b 连接,确实可以了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 13:27:13',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115488,num:13,uid:149,content:'网页播放器的性能很有限,改用其他的播放 APp',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:14:31',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115489,num:14,uid:684,content:'别吹 emby/jellfin 了\u003Cbr\u003E这两个软件默认的刮削烂的流汤,**中的战斗机\u003Cbr\u003E飞牛刮削算很好的了.都不用到播放的场景.多年前我就放弃了 plex/jellyfin 就是因为这个',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 15:54:11',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115490,num:15,uid:546,content:'就像楼上说的,网页播放的话,飞牛如果经常卡,那么你换 emby plex 等同样会卡。\u003Cbr\u003E\u003Cbr\u003E要么升级 nas 配置,要么使用播放器。',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:18:56',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115491,num:16,uid:19115,content:'**b 共享,windows 用 potpalyer 直接观看,2160 秒开,拉进度秒读取\u003Cbr\u003E或者后端 jellyfin ,windows 用 kodi\u003Cbr\u003E移动端用 vlc 播放 **b ,或者 vidhub 播放 emby 视频',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:23:16',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115492,num:17,uid:18562,content:'直接 **b 挂载,然后 mac 上用 infuse 或者 iina ,windows 用 vlc 或者 potplayer',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:50:54',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115493,num:18,uid:5753,content:'我的一般是 播放一个小时后 ,后半段卡顿, 关了重进就好了',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 16:55:33',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},{id:115494,num:19,uid:2374,content:'emby+iina/potplayer',ipRegion:'',updatedByUid:0,createdAt:'2025-04-17 19:42:14',updatedAt:'2025-04-19 23:48:06',mentionNum:0,mentionedBy:[],mentionUsers:[],likeUsers:[],},],usersMap:new Map([[15338,{uid:15338,url:'/u/362253006a045d7263695e6f01396177',avatar:'/a/362253006a045d7263695e6f01396177',username:'tetora🤖',}],[5753,{uid:5753,url:'/u/2818591b6a045c72676f556f14180311',avatar:'/a/2818591b6a045c72676f556f14180311',username:'183387594🤖',}],[149,{uid:149,url:'/u/1d280a246a045c77616e5f6f052b1708',avatar:'/a/1d280a246a045c77616e5f6f052b1708',username:'alfawei🤖',}],[2374,{uid:2374,url:'/u/6e7a41286a045c75636d526f30513f12',avatar:'/a/6e7a41286a045c75636d526f30513f12',username:'jqtmviyu🤖',}],[3971,{uid:3971,url:'/u/0c0050186a045c74696d576f032c1008',avatar:'/a/0c0050186a045c74696d576f032c1008',username:'duanxianze🤖',}],[19115,{uid:19115,url:'/u/6c2d6b1e6a045d7e616b536f1d1c2a32',avatar:'/a/6c2d6b1e6a045d7e616b536f1d1c2a32',username:'babaYaga🤖',}],[18868,{uid:18868,url:'/u/167d6a5e6a045d7f686c5e6f410e3473',avatar:'/a/167d6a5e6a045d7f686c5e6f410e3473',username:'webwlx🤖',}],[446,{uid:446,url:'/u/2a1141006a045c77646e506f1022350a',avatar:'/a/2a1141006a045c77646e506f1022350a',username:'JensenQian🤖',}],[15900,{uid:15900,url:'/u/390b00076a045d72696a566f45046721',avatar:'/a/390b00076a045d72696a566f45046721',username:'vr4y🤖',}],[13449,{uid:13449,url:'/u/1d135a2b6a045d74646e5f6f4302002e',avatar:'/a/1d135a2b6a045d74646e5f6f4302002e',username:'liuyin🤖',}],[684,{uid:684,url:'/u/232c68556a045c776662526f471d1213',avatar:'/a/232c68556a045c776662526f471d1213',username:'m1nm13🤖',}],[18562,{uid:18562,url:'/u/1404640e6a045d7f656c546f1c222102',avatar:'/a/1404640e6a045d7f656c546f1c222102',username:'fuckfaker🤖',}],[18468,{uid:18468,url:'/u/2e3e70256a045d7f646c5e6f01043b03',avatar:'/a/2e3e70256a045d7f646c5e6f01043b03',username:'CherryGods🤖',}],[546,{uid:546,url:'/u/283957546a045c77656e506f0113110e',avatar:'/a/283957546a045c77656e506f0113110e',username:'tunggt🤖',}],[584,{uid:584,url:'/u/372f012a6a045c776562526f423f0b08',avatar:'/a/372f012a6a045c776562526f423f0b08',username:'hokori🤖',}],[13507,{uid:13507,url:'/u/682b073f6a045d74656a516f1c1d3c00',avatar:'/a/682b073f6a045d74656a516f1c1d3c00',username:'Jisxu🤖',}],[528,{uid:528,url:'/u/303d51086a045c7765685e6f46270a32',avatar:'/a/303d51086a045c7765685e6f46270a32',username:'ihainan🤖',}],[18796,{uid:18796,url:'/u/0b024b2f6a045d7f6763506f44130a72',avatar:'/a/0b024b2f6a045d7f6763506f44130a72',username:'wizzer🤖',}],]),related:[],} const App={setup(){const goTo=useGoTo() const{mdAndUp}=useDisplay() return{goTo,mdAndUp}},data(){return data;},mounted(){const themeDark=localStorage.getItem("themeDark") if(themeDark!==null){this.theme.dark=JSON.parse(themeDark)} if(this.nav.post.total>(this.nav.post.currentPage-1)*100+20){let moreLen=100 if(this.nav.post.total({id:null,num:(this.nav.post.currentPage-1)*100+v,uid:null,content:null,ipRegion:null,updatedByUid:null,createdAt:null,updatedAt:null,mentionNum:null,mentionedBy:null,mentionUsers:null,likeUsers:null,})) this.posts.push(...morePosts.slice(20))} this.workerStart() const hash=window.location.hash const match=hash.match(/#(\d+)/) if(match){const n=parseInt(match[1],10) if(n>=(this.nav.post.currentPage-1)*100&&n{this.jumpTo(n)})}} this.$nextTick(()=>{this.addHeadingIds() tocbot.init({tocSelector:'.toc',contentSelector:'#post-content-0',headingSelector:'h2, h3, h4',headingsOffset:100,scrollSmoothOffset:-100,scrollSmooth:true,collapseDepth:6,onClick:function(e){setTimeout(()=>{history.replaceState(null,'',window.location.pathname+window.location.search)},0)},}) tocbot.refresh()});},beforeUnmount(){this.workerStop() if(this.quill){this.quill.destroy() this.quill=null}},computed:{dposts(){return this.posts.slice(20);},},created(){},methods:{successAlert(msg){this.alert={show:true,color:'success',text:msg,timeout:1500,}},failureAlert(msg){this.alert={show:true,color:'error',text:msg,timeout:5000,}},flipThemeDark(){this.theme.dark=!this.theme.dark localStorage.setItem("themeDark",JSON.stringify(this.theme.dark))},toSearch(){if(!this.search.text){this.failureAlert('搜索词不能为空') return} let keywords=this.search.text.trim() if(keywords.length<1){this.failureAlert('搜索词不能为空') return} if(keywords.length>100){this.failureAlert('搜索词过长') return} this.doSearch(keywords)},toReg(){window.location.href="/reg"},toLogin(){window.location.href="/login"},toPage(){let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,this.nav.post.targetPage>1?`/${this.nav.post.targetPage}`:'') window.location.href=url},toLoadRelated({done}){if(this.my&&this.my.uid){this.apiLoadRelated({done})}else{done('ok')}},workerStart(){this.nav.post.worker=setInterval(()=>{this.workerLoad()},500);},workerStop(){if(this.nav.post.worker){clearInterval(this.nav.post.worker);this.nav.post.worker=null;}},async jumpTo(num){const page=Math.floor(num/100)+1 const i=num-(page-1)*100 if(page===this.nav.post.currentPage){this.goTo("#post-"+num,this.nav.post.goToOptions) if(!this.posts[i].id){const block=Math.floor(num/20)+1 this.nav.post.apiLock[block]=true await this.apiLoadPosts(block) this.$nextTick(()=>{this.goTo("#post-"+num,this.nav.post.goToOptions)})}}else{let url=window.location.href url=url.replace(/(\/\d+)?(#[0-9]+)?$/,page>1?`/${page}`:'') url=url+"#"+num window.location.href=url}},postIntersect(num){return(isIntersecting,entries,observer)=>{if(isIntersecting){this.nav.post.task.push(num) this.nav.post.active.push(num) this.nav.post.active=this.nav.post.active.filter(item=>Math.abs(item-num)<=5) this.nav.post.active.sort((a,b)=>a-b)}else{this.nav.post.active=this.nav.post.active.filter(item=>item!==num)} if(this.nav.post.active[0]){this.nav.post.anchor=this.nav.post.active[0]}else{this.nav.post.anchor=0}}},async apiLoadPosts(block){try{const response=await axios.post('/fapi/v1/post/block/'+block,{discussionId:this.nav.post.discussionId,}) if(response.data.code===0){response.data.data.posts.forEach(post=>{const i=post.num%100 Object.assign(this.posts[i],post)}) response.data.data.users.forEach(user=>{this.usersMap.set(user.uid,user)})}else{this.failureAlert('回帖数据加载失败: '+response.data.msg)}}catch(error){this.failureAlert('回帖数据加载失败: '+error)} this.nav.post.apiLock[block]=false},workerLoad(){while(this.nav.post.task.length){const num=this.nav.post.task.pop() const i=num-(this.nav.post.currentPage-1)*100 if(!this.posts[i].id){const block=Math.floor(num/20)+1 if(!this.nav.post.apiLock[block]){this.nav.post.apiLock[block]=true this.apiLoadPosts(block)}}}},getTimeInfo(t){if(!t){return ""} const now=new Date();const then=new Date(t);const diff=now-then;const minute=60*1000;const hour=minute*60;const day=hour*24;const month=day*30;const year=month*12;if(diffpost.num===num) if(!post){return "#"+num} const uid=post.uid const username=this.usersMap.get(uid)?.username if(!username){return "#"+num} return username},getUsernameByPostId(id){const post=this.posts.find(post=>post.id===id) if(!post){return "#"+this.getPostNumByPostId(id)} const uid=post.uid const username=this.usersMap.get(uid).username if(!username){return "#"+this.getPostNumByPostId(id)} return username},getPostNumByPostId(id){const post=this.posts.find(post=>post.id===id) return post.num},getPostById(id){const post=this.posts.find(post=>post.id===id) return post},getPostByNum(num){const post=this.posts.find(post=>post.num===num) return post},getAvatarByUid(uid){const avatar=this.usersMap.get(uid)?.avatar if(!avatar){return this.getRandomAvatar()} return avatar},getAvatarByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post){return this.getRandomAvatar()} const uid=post.uid return this.getAvatarByUid(uid)},getRandomAvatar(){const num=Math.floor(Math.random()*100) return "https://randomuser.me/api/portraits/men/"+num+".jpg"},getUrlByUid(uid){const url=this.usersMap.get(uid)?.url if(!url){return ""} return url},getTextByPostNum(num){const post=this.posts.find(post=>post.num===num) if(!post||!post.content){return '点击跳转到#'+num+'查看'} const parser=new DOMParser() const doc=parser.parseFromString(post.content,'text/html') const text=doc.body.textContent||'' return text.slice(0,100)},addHeadingIds(){const content=document.getElementById('post-content-0') if(!content){this.nav.showTOC=false return} const headings=content.querySelectorAll('h2, h3, h4') headings.forEach((heading,index)=>{if(!heading.id){heading.id=`toc-nav-${index}`}}) if(headings.length==0){this.nav.showTOC=false}},async doSearch(keywords){this.search.loading=true try{const response=await axios.post('/fapi/v1/search',{keywords:keywords,}) if(response.data.code===0){if(response.data.data.hash&&response.data.data.hash.length===32){window.location.href="/s/"+response.data.data.hash}else{this.failureAlert('搜索失败: 搜索服务异常')}}else{this.failureAlert('搜索失败: '+response.data.msg)}}catch(error){this.failureAlert('搜索失败: '+error)} this.search.loading=false},debounce(fn,delay){let timer=null return function(...args){if(timer)clearTimeout(timer) timer=setTimeout(()=>{fn.apply(this,args)},delay);};},},watch:{'nav.post.targetPage':{handler:async function(newV,oldV){this.toPage()},immediate:false},},} const vuetify=createVuetify({defaults:{global:{ripple:true,},},}) const app=createApp(App) app.use(vuetify).mount("#app")