PageSourceSearch

https://www.methodlearning.com/build/assets/MediaTracking-DZSwyQgU.js

js methodlearning.com collected 2026-09-28 11:02:52 UTC 2,600 bytes, 1 lines download raw bytes

1import{o as n,c as o,a as d,d as m}from"./instance-CaiqpZWj.js";import{_ as l}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./___vite-browser-external_commonjs-proxy-Dtmx4hP1.js";const c={name:"MediaTracking",props:{type:String,mediaId:Number,mediaUrl:String,playing:Boolean,track:{default:!0,type:Boolean}},data(){return{currentTime:0,timePlayed:0,secondsBeforeSync:3,interval:!1,playingProxy:this.playing}},computed:{mediaElement(){return this.$refs.media},preview(){return this.$store.state.quiz.preview},admin(){return this.$store.state.quiz.admin}},watch:{playing(e){this.playingProxy=e,e?this.mediaElement.paused&&this.mediaElement.play():this.mediaElement.play&&this.mediaElement.pause()},playingProxy(e){e?(this.currentTime==0&&!this.admin&&this.mediaElement&&(this.mediaElement.ontimeupdate=()=>{this.currentTime=this.mediaElement.currentTime}),this.$emit("update:playing",!0),this.interval=setInterval(()=>{this.timePlayed++},1e3)):(this.$emit("update:playing",!1),this.interval&&clearInterval(this.interval))},timePlayed(){this.timePlayed%this.secondsBeforeSync===0&&this.syncTime()}},mounted(){!this.admin&&this.track&&axios.get("/media/"+this.mediaId+"/progress").then(e=>{e.data.progress&&(this.mediaElement.currentTime=e.data.progress.current_time)}).catch(e=>{console.log("total watch retrieval error:",e)})},methods:{syncTime(){!this.admin&&this.track&&axios.put("/media/"+this.mediaId+"/progress",{current_time:this.currentTime,timePlayed:this.secondsBeforeSync,duration:this.mediaElement.duration??0}).then(e=>{}).catch(e=>{console.log("time synced error",e)})},finishedMedia(){this.track&&!this.admin&&axios.put("/media/"+this.mediaId+"/progress/complete").catch(e=>{console.log("media completion error:",e)})}}},h={class:"media-wrap"},u={key:0,class:"ratio ratio-16x9"},p=["src"],y={key:1,class:"media-audio text-center p-3"},f=["src"];function g(e,t,s,v,r,a){return n(),o("div",h,[s.type==="video"?(n(),o("div",u,[d("video",{ref:"media",controls:"",controlsList:"nodownload",poster:"https://images.methodtestprep.com/methodize/video-poster.png",onPlay:t[0]||(t[0]=i=>r.playingProxy=!0),onPause:t[1]||(t[1]=i=>r.playingProxy=!1),onEnded:t[2]||(t[2]=(...i)=>a.finishedMedia&&a.finishedMedia(...i)),src:s.mediaUrl},null,40,p)])):m("",!0),s.type==="audio"?(n(),o("div",y,[d("audio",{ref:"media",controls:"",controlsList:"nodownload",onPlay:t[3]||(t[3]=i=>r.playingProxy=!0),onPause:t[4]||(t[4]=i=>r.playingProxy=!1),onEnded:t[5]||(t[5]=(...i)=>a.finishedMedia&&a.finishedMedia(...i)),src:s.mediaUrl},null,40,f)])):m("",!0)])}const k=l(c,[["render",g]]);export{k as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.