1$(document).ready(function () { 2 // ãããªã³ã³ãããæºå 3 const videoContainer = document.getElementById("video-container"); 4 5 // ãã¬ã¤ã¤ã¼ã®è¨å®ãæºå 6 const playerConfig = { 7 key: "d0167b1c-9767-4287-9ddc-e0fa09d31e02", 8 ui: true, // UIãæå¹ã«ãã 9 // åçè¨å® 10 playback: { 11 autoplay: true, // èªååçãªã³ 12 playsInline: false, // iOSçã§å ¨ç»é¢è¡¨ç¤ºã«ãã 13 }, 14 }; 15 16 // ãããªã³ã³ããã¨ãã¬ã¤ã¤ã¼è¨å®ã§ãã¬ã¤ã¤ã¼ãåæå 17 let player = new mkplayer.MKPlayer(videoContainer, playerConfig); 18 19 // iPhoneãã©ããã夿ãã颿° 20 function isiPhone() { 21 return /iPhone|iPod/.test(navigator.userAgent) && !window.MSStream; 22 } 23 24 player.on(mkplayer.MKPlayerEvent.SourceLoaded, () => { 25 // SourceLoadedã¤ãã³ããçºçããéã«ãiPhoneã®å ´åã®ã¿videoè¦ç´ ã«controls屿§ã追å ãã 26 if (isiPhone()) { // iPhoneã®å ´å 27 const videoElement = videoContainer.querySelector("video"); 28 if (videoElement) { 29 videoElement.controls = true; // controls屿§ãä»ä¸ 30 } 31 32 // SourceLoadedã¤ãã³ããçºçããéã«ãiPhoneã®å ´åã®ã¿is-iphoneã¯ã©ã¹ãä»ä¸ 33 $('.bmpui-ui-controlbar').addClass('is-iphone'); 34 $('.bmpui-ui-titlebar').addClass('is-iphone'); 35 $('.bmpui-image').addClass('is-iphone'); 36 $('.bmpui-ui-playbacktoggle-overlay').addClass('is-iphone'); 37 } 38 }); 39 40 $('.c-modal-open').each(function () { 41 $(this).on('click', function () { 42 // ã¢ã¼ãã«ç¨ 43 var target = $(this).data('target'); 44 var modal = $('#' + target); 45 $(modal).addClass('is-active'); 46 scroll = $(window).scrollTop(); 47 $('body').css({ 48 'left': 0, 49 'overflow': 'hidden scroll', 50 'position': 'fixed', 51 'top': -1 * scroll, 52 'width': '100%' 53 }); 54 // åç»åçç¨ 55 var src = $(this).data('src'); // HTMLããHLSå½¢å¼ã®åç»URLãåå¾ 56 console.log(src); 57 const sourceConfig = { 58 hls: src, // HLSå½¢å¼ã®åç»URL 59 }; 60 // ã½ã¼ã¹ãèªã¿è¾¼ã¿ 61 player.load(sourceConfig); 62 return false; 63 }); 64 }); 65 66 $('.c-modal-close').each(function () { 67 $(this).on('click', function () { 68 // ã¢ã¼ãã«ç¨ 69 $('.p-video-modal').removeClass('is-active'); 70 $('body').removeAttr('style'); 71 $('html, body').prop({ scrollTop: scroll }); 72 73 // åç»åçç¨ 74 // ã¢ã¼ãã«ãéããæã«åç»ã®åçãæ¢ãã 75 if (player) { 76 player.unload(); 77 } 78 return false; 79 }); 80 }); 81 82 // åç»è¦è´ãã°å¦ç 83 let logpoint_array = [ 84 { "percentage": 0.01, "change_column": "start_count", "complete": false }, 85 { "percentage": 25, "change_column": "firstpoint_count", "complete": false }, 86 { "percentage": 50, "change_column": "midpoint_count", "complete": false }, 87 { "percentage": 75, "change_column": "thirdpoint_count", "complete": false }, 88 { "percentage": 100, "change_column": "end_count", "complete": false } 89 ]; 90 91 let not_use_ajax; 92 93 if (typeof data === "undefined" || Object.keys(data).length === 0) { 94 var ajax_data = []; 95 } else { 96 var ajax_data = data; 97 } 98 99 if (typeof use_logpoint != "undefined" && Object.keys(use_logpoint).length > 0) { 100 player.on(mkplayer.MKPlayerEvent.TimeChanged, (event) => { 101 const duration = player.getDuration(); 102 let currentTime = player.getCurrentTime() + 1; 103 let percentage = (currentTime / duration) * 100; 104 let logpoint = logpoint_array.find((logpoint) => { 105 return percentage >= logpoint.percentage && !logpoint.complete; 106 }); 107 if (logpoint) { 108 let index = logpoint_array.indexOf(logpoint); 109 let val = use_logpoint[index + 1]; 110 ajax_data["change_column"] = logpoint_array[index]["change_column"]; 111 logpoint_array[index].complete = true; 112 if (typeof not_use_ajax === "undefined" || !not_use_ajax) { 113 $.ajax({ 114 url: val, 115 type: 'POST', 116 data: ajax_data, 117 headers: { 118 "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"), 119 }, 120 timeout: 50000 121 }).done(function (data) { 122 if (logpoint_array[index]["percentage"] == 100) { 123 not_use_ajax = true; 124 if (typeof ajax_success == "function") { 125 ajax_success(); 126 } 127 } 128 }).fail(function (jqXHR, textStatus, errorThrown) { 129 console.log("fail"); 130 console.log(jqXHR); 131 console.log(textStatus); 132 console.log(errorThrown); 133 }); 134 } else { 135 if (typeof ajax_success == "function" && logpoint_array[index - 1]["logpoint"] == "ended") { 136 ajax_success(); 137 } 138 } 139 } 140 }); 141 } 142});
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.