PageSourceSearch

https://hanoi.edu.vn/js/qi-nhung-video.js?v=1

js hanoi.edu.vn collected 2026-10-02 11:30:16 UTC 1,976 bytes, 41 lines download raw bytes

1/* =============================================================================
2   NHÚNG VIDEO YOUTUBE KIỂU "BẤM MỚI TẢI" (2026-08-12)
3   Cặp với: QIWEB_BO/Base/HtmlBuild.cs → TagIframeEmbederYoutube
4
5   Máy chủ chỉ in ảnh đại diện video (~10–20 KB) kèm nút phát. Bấm vào thì tệp này mới chèn khung
6   nhúng thật kèm `autoplay=1`, nên vẫn đúng MỘT cú bấm như khung nhúng cũ (khung cũ cũng phải bấm nút
7   phát), mà người không xem thì không phải tải ~1 MB script của Google.
8
9   Dùng uỷ quyền sự kiện ở `document` nên chạy được cả với khối video nạp SAU (băng trượt, tab, htmx).
10   ========================================================================== */
11(function () {
12    'use strict';
13
14    function chenKhung(nut) {
15        var ma = nut.getAttribute('data-qi-video');
16        if (!ma) return;
17
18        var khung = document.createElement('iframe');
19        khung.className = 'embed-responsive-item';
20        khung.setAttribute('src',
21            'https://www.youtube.com/embed/' + encodeURIComponent(ma) + '?autoplay=1&rel=0');
22        khung.setAttribute('title', nut.getAttribute('title') || 'Video');
23        khung.setAttribute('allow',
24            'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture');
25        khung.setAttribute('allowfullscreen', 'allowfullscreen');
26        khung.setAttribute('frameborder', '0');
27
28        var cha = nut.parentNode;
29        if (cha) cha.replaceChild(khung, nut);
30    }
31
32    document.addEventListener('click', function (e) {
33        var nut = e.target && e.target.closest ? e.target.closest('.qi-video-mo') : null;
34        if (!nut) return;
35        e.preventDefault();
36        chenKhung(nut);
37    });
38
39    //  Bàn phím: thẻ đã là <button> nên Enter/Space tự phát ra 'click'. Không cần xử lý thêm —
40    //  ghi ra đây để lần sau khỏi thêm trùng.
41})();

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.