PageSourceSearch

https://postech.ac.kr/_res/postech/kor/js/main-video-management.widget.js?36907

js postech.ac.kr collected 2026-09-24 08:32:48 UTC 1,211 bytes, 51 lines download raw bytes

1$(function(){
2
3  let idx = 0; // ✅ FIX
4  const $introVideo = $('[data-random-loop]');
5  if(!$introVideo.length) return;
6
7  const video = $introVideo[0];
8
9  let randomVideoArr = randomVideo.slice(1, -1).split(",").map(s => s.trim());
10//  console.log("[INTRODBG] playlist =", randomVideoArr);
11
12  function safePlay(from){
13    console.log("[INTRODBG] play()", from, "src=", video.currentSrc || video.src);
14    const p = video.play();
15    if(p?.catch){
16      p.catch(err => console.log("[INTRODBG] play rejected:", err));
17    }
18  }
19
20  function playNext(){
21    console.log("[INTRODBG] ended → playNext",
22      "idx=", idx,
23      "ct=", video.currentTime,
24      "dur=", video.duration
25    );
26
27    if(!randomVideoArr.length) return;
28
29    // ✅ 영상 1개면 loop
30    if(randomVideoArr.length === 1){
31      video.loop = true;
32      safePlay("single");
33      return;
34    }
35
36    idx = (idx + 1) % randomVideoArr.length;
37    const nextSrc = randomVideoArr[idx];
38
39  //  console.log("[INTRODBG] switch to", nextSrc);
40
41    video.muted = true;
42    video.playsInline = true;
43    video.autoplay = true;
44
45    video.src = nextSrc;
46    video.load();
47    safePlay("next");
48  }
49
50  video.addEventListener('ended', playNext);
51});

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.