1(function ($) { 2 $(window).on("elementor/frontend/init", function () { 3 //this is for HTML5 VIDEO player 4 elementorFrontend.hooks.addAction("frontend/element_ready/Html5VideoPlayer.default", function (scope, $) { 5 //this is for HTML5 vedio player 6 const playerElement = $(scope).find("video"); 7 let controls = $(playerElement).attr("data-settings"); 8 /* console.log(controls);*/ 9 controls = JSON.parse(controls); 10 controls = Object.keys(controls).map((index) => { 11 if (controls[index] == "yes") { 12 return index; 13 } 14 }); 15 const player = new Plyr(playerElement, { 16 tooltips: { controls: true }, 17 }); 18 }); 19 20 //this is for HTML5 Audio player 21 elementorFrontend.hooks.addAction("frontend/element_ready/Html5AudioPlayer.default", function (scope, $) { 22 const playerElement = $(scope).find(".audio_player"); 23 24 let controls = $(playerElement).attr("data-settings"); 25 controls = JSON.parse(controls); 26 controls = Object.keys(controls).map((index) => { 27 if (controls[index] == "yes") { 28 return index; 29 } 30 }); 31 const player = new Plyr(playerElement, { 32 tooltips: { controls: true }, 33 }); 34 }); 35 36 //this is for HTML5 youtube player 37 elementorFrontend.hooks.addAction("frontend/element_ready/YoutubeVideoPlayer.default", function (scope, $) { 38 const playerElement = $(scope).find(".youtube_player"); 39 40 let controls = $(playerElement).attr("data-settings"); 41 controls = JSON.parse(controls); 42 controls = Object.keys(controls).map((index) => { 43 if (controls[index] == "yes") { 44 return index; 45 } 46 }); 47 const player = new Plyr(playerElement, { 48 tooltips: { controls: true }, 49 }); 50 }); 51 52 //this is for vimeo player 53 elementorFrontend.hooks.addAction("frontend/element_ready/VemioVideoPlayer.default", function (scope, $) { 54 const playerElement = $(scope).find(".vimeo_player"); 55 56 let controls = $(playerElement).attr("data-settings"); 57 controls = JSON.parse(controls); 58 controls = Object.keys(controls).map((index) => { 59 if (controls[index] == "yes") { 60 return index; 61 } 62 }); 63 const player = new Plyr(playerElement, { 64 tooltips: { controls: true }, 65 }); 66 }); 67 68 // this is a art player 69 elementorFrontend.hooks.addAction("frontend/element_ready/artvideoplayer.default", function (scope, $) { 70 const playerElement = $(scope).find(".artplayer-app"); 71 72 let settings = $(playerElement).attr("data-settings"); 73 let controls = $(playerElement).data("controls"); 74 const id = $(playerElement).attr("id"); 75 76 settings = JSON.parse(settings); 77 78 const { multiple_quality } = controls; 79 80 Object.keys(controls).map((index) => { 81 if (controls[index] == "yes") { 82 controls[index] = true; 83 } else { 84 controls[index] = false; 85 } 86 }); 87 88 //for single video 89 let single_video = ""; 90 if (settings.srrc_type == "liink") { 91 single_video = settings.vxideoos_link; 92 } else { 93 single_video = settings.vxideoos_upload.url; 94 } 95 96 //for subtitle 97 const subtitle = { 98 color: settings.sub_bg, 99 }; 100 if (settings.sxrc_typed === "linkks") { 101 subtitle.url = settings.sxubtitle_link; 102 } else { 103 subtitle.url = settings.sxubtitle_upload.url; 104 } 105 106 //for multiple quality 107 const video_list = settings.vxideo_list; 108 let newVideiList = []; 109 if (multiple_quality == "yes") { 110 newVideiList = video_list.map((item) => { 111 const video = {}; 112 video.name = item.vxideo_size; 113 if (item.sxrc_type == "link") { 114 video.url = item.vxideoos_link; 115 } else { 116 video.url = item.vxideoos_upload.url; 117 } 118 119 return video; 120 }); 121 122 if (newVideiList.length > 0) { 123 single_video = newVideiList[0].url; 124 } 125 } 126 127 const player = new Artplayer({ 128 container: "#" + id, 129 url: `${single_video}`, 130 poster: `${settings.bar_img.url}`, 131 volume: 0.5, 132 isLive: false, 133 muted: false, 134 autoplay: false, 135 pip: true, 136 autoSize: true, 137 autoMini: true, 138 screenshot: true, 139 setting: true, 140 loop: true, 141 flip: true, 142 rotate: true, 143 playbackRate: true, 144 aspectRatio: true, 145 fullscreen: true, 146 fullscreenWeb: true, 147 subtitleOffset: true, 148 miniProgressBar: true, 149 localVideo: true, 150 localSubtitle: true, 151 networkMonitor: false, 152 mutex: true, 153 light: true, 154 backdrop: true, 155 theme: `${settings.vd_color}`, 156 157 lang: navigator.language.toLowerCase(), 158 moreVideoAttr: { 159 crossOrigin: "anonymous", 160 }, 161 contextmenu: [ 162 { 163 html: "Custom menu", 164 click: function (contextmenu) { 165 console.info("You clicked on the custom menu"); 166 contextmenu.show = false;
167 }, 168 }, 169 ], 170 171 quality: newVideiList, 172 subtitle: { 173 url: `${subtitle.url}`, 174 style: { 175 color: `${subtitle.color}`, 176 }, 177 encoding: "utf-8", 178 bilingual: true, 179 }, 180 181 icons: { 182 state: `<img src="${settings.video_album_poster.url}">`, 183 }, 184 }); 185 }); 186 187 elementorFrontend.hooks.addAction("frontend/element_ready/dPlayer.default", function (scope, $) { 188 189 const playerElement = $(scope).find("#dplayer"); 190 191 let settings = $(playerElement).attr("data-settings"); 192 settings = JSON.parse(settings); 193 194 let subtitleUrl = ""; 195 if (typeof settings.dplayer_upload != "undefined") { 196 subtitleUrl = settings.dplayer_upload.url; 197 } 198 //for multiple quality 199 const video_d_list = settings.video_d_list; 200 let newVideiList = []; 201 if (settings.choose_v_source === "yes") { 202 newVideiList = video_d_list.map((item) => { 203 const video = {}; 204 video.name = item.video_d_size; 205 video.type = "auto"; 206 if (item.src_v_type == "link") { 207 video.url = item.video_v_link; 208 } else { 209 video.url = item.video_v_upload.url; 210 } 211 212 return video; 213 }); 214 } else { 215 if (settings.srrc_type == "liink") { 216 single_video = settings.videoos_link; 217 } else { 218 single_video = settings.videoos_upload.url; 219 } 220 newVideiList = [ 221 { 222 url: single_video, 223 type: "auto", 224 }, 225 ]; 226 } 227 228 const options = { 229// container: document.getElementById("dplayer"), 230 container: playerElement[0], 231 theme: settings.player_theme, 232 lang: "en", 233 screenshot: true, 234 hotkey: true, 235 preload: "auto", 236 volume: 0.7, 237 mutex: true, 238 video: { 239 quality: newVideiList, 240 defaultQuality: 0, 241 }, 242 subtitle: { 243 url: subtitleUrl, 244 type: "webvtt", 245 fontSize: settings.p_font, 246 bottom: "10%", 247 color: settings.sub_d_bg, 248 }, 249 }; 250 251 if (settings.custom_banner_d === "true") { 252 options.video.thumbnails = settings.banner.url; 253 options.video.pic = settings.banner.url; 254 } 255 256 if (settings.custom_logo_d === "true") { 257 options.logo = settings.d_logo.url; 258 } 259 260 if (settings.auto_play === "yes") { 261 options.autoplay = true; 262 } 263 if (settings.video_loop === "yes") { 264 options.loop = true; 265 } 266 267 const dp = new DPlayer(options); 268 }); 269 }); 270})(jQuery);
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.