{"version":3,"sources":["node_modules/@babel/runtime/helpers/classCallCheck.js","node_modules/@babel/runtime/helpers/createClass.js","src/js/config/defaults.js","node_modules/@babel/runtime/helpers/defineProperty.js","src/js/util/isHelper.js","src/js/util/objectHelper.js","src/js/util/bootstrapHelper.js","src/js/util/debugHelper.js","src/js/note.js","src/js/caption.js","src/js/slide.js","src/js/exception.js","src/js/util/hide-yt.js","src/js/loader.js","src/js/util/conversionHelper.js","src/js/ui.js","src/js/progress.js","src/js/quiz.js","node_modules/@babel/runtime/helpers/typeof.js","node_modules/@babel/runtime/helpers/arrayWithHoles.js","node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","node_modules/@babel/runtime/helpers/nonIterableRest.js","node_modules/@babel/runtime/helpers/slicedToArray.js","src/js/options.js","src/js/events.js","src/js/chat.js","src/js/config/plyr-defaults.js","src/js/config/wlp-defaults.js","src/js/welearnpro-video.js"],"names":["defaults","previewMode","embedVideo","user","video","thumbnail","seekable","debug","slidesync","progress","update","url","interval","alert","alertMessage","load","pageElement","videoModal","note","get","save","successMessage","failureMessage","instructionMessage","messageTimeout","delete","chat","quiz","invokeOnce","getConstructor","input","constructor","instanceOf","Boolean","isNullOrUndefined","isObject","Object","isNumber","Number","isNaN","isString","String","isBoolean","isFunction","Function","isArray","Array","isWeakMap","WeakMap","isNodeList","NodeList","isElement","Element","isTextNode","Text","isEvent","Event","isKeyboardEvent","KeyboardEvent","isCue","window","TextTrackCue","VTTCue","isTrack","TextTrack","kind","isPromise","Promise","isEmpty","length","keys","isUrl","URL","string","startsWith","hostname","e","nullOrUndefined","object","number","boolean","function","array","weakMap","nodeList","element","textNode","event","keyboardEvent","cue","track","promise","empty","extend","target","sources","source","shift","is","forEach","key","includes","assign","Bootstrap4Helper","message","timeout","$","after","setTimeout","noop","Debug","enabled","console","prototype","bind","call","log","warn","error","Note","player","courseSectionModuleId","urlParams","URLSearchParams","location","search","self","ajax","options","data","CourseSectionModuleId","async","type","success","result","addClass","remove","_bind_noteEvent","text","time","plyrPlayer","currentTime","VideoId","progressData","videoId","Message","Time","Math","floor","notify","val","noteId","NoteId","useSeekableOption","barTime","hasClass","invokeAlert","i18n","Caption","label","srclang","src","setDefault","append","Slide","syncSlide","unsyncSlide","css","color","slidePage","fancybox","getInstance","carousel","jumpTo","Exception","find","HideYt","document","addEventListener","hideYTActivated","onYouTubeIframeAPIReadyCallbacks","playerWrap","playerFrame","querySelector","tag","createElement","firstScriptTag","getElementsByTagName","parentNode","insertBefore","onPlayerStateChange","YT","PlayerState","ENDED","classList","add","PAUSED","PLAYING","push","Player","events","playerState","getPlayerState","seekTo","playVideo","querySelectorAll","onYouTubeIframeAPIReady","callback","Loader","exception","caption","loadEmbedVideo","loadVideoSources","loadCaptions","videoPlayer","attr","convertVideoToEmbedded","videoPlayerElementName","id","replaceWith","origin","userId","loadWatchedProgress","loadQuizs","i","values","videoComponent","captions","addCaption","slide","pages","page","test","testId","Convert","seconds","d","h","m","s","slice","UI","plyrElement","_renderProgressBar","_seekablePlyrProgressBar","videoDuration","duration","toTimestamp","tooltip","template","canSeek","Progress","timestamp","each","progressPercentage","cid","courseId","csm","cb","courseBatchId","jqXhr","JSON","stringify","always","statusCode","status","specialResponse","parse","getResponseHeader","isSentWithoutIssue","isAlertEnabled","Swal","fire","title","then","value","href","encodeURIComponent","QuizFlags","freeze","finished","Symbol","unfinished","Quiz","quizId","quizCourseSectionModuleId","buildProgressData","updateVideoData","vid","cs","courseSectionId","vidcsm","pause","html","modal","backdrop","keyboard","show","_enableNavigations","flag","urlOptions","params","paramObj","option","playPromise","play","catch","Events","previousQuiz","_bindEvents","ui","loader","ready","_bind_listeners","_bind_documentready","_bind_onloadeddata","_bind_timeupdate","_bind_chatEvent","wlp","plyr","config","listeners","seek","disableSeekForUnseekablePlayer","newTime","_getTargetTime","defineProperty","defaultPrevented","writable","preventDefault","on","timeToForward","off","getChat","getNote","noteArea","which","keyCode","wlpVideo","createNote","blur","oldText","updateNote","updateRepeater","initEvent","bindWlpPlayer","loadVideoData","undefined","setInterval","playing","getOptionsFromUrl","entries","command","applyOption","_typeof","max","media","currentTimestamp","isSyncSlideEnabled","hasSlide","slideSync","slideData","currentSlide","previousSlides","filter","pop","changeSlidePage","isHasQuiz","isAlreadyInvoked","isInvokeOnce","hasInvokedState","fullscreen","active","exit","invokeQuiz","Chat","insert","urlQuestion","courseChatQuestionId","urlAnswer","CourseChatQuestionId","previewModeControls","learningModeControls","learningModeSettings","previewModeSettings","plyrControls","plyrSettings","plyrWlpOptions","fallback","iosNative","youtube","playsinline","controls","showinfo","ratio","blankVideo","settings","wlpDefaultsOptions","WeLearnProPlayer","plyrOptions","initVideo","bindPlyr","Plyr","canvas","getElementById","getContext","drawImage","videoWidth","videoHeight","unloadQuiz","passConditions","watchedPercentage","watchedSeconds","languages"],"mappings":";;AAAA,SAAS,eAAe,CAAC,QAAQ,EAAE,WAAW,EAAE;EAC9C,IAAI,EAAE,QAAQ,YAAY,WAAW,CAAC,EAAE;IACtC,MAAM,IAAI,SAAS,CAAC,mCAAmC,CAAC,CAAC;GAC1D;CACF;;AAED,kBAAc,GAAG,eAAe;;ACNhC,SAAS,iBAAiB,CAAC,MAAM,EAAE,KAAK,EAAE;EACxC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;IACrC,IAAI,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1B,UAAU,CAAC,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,KAAK,CAAC;IACvD,UAAU,CAAC,YAAY,GAAG,IAAI,CAAC;IAC/B,IAAI,OAAO,IAAI,UAAU,EAAE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC;IACtD,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;GAC3D;CACF;;AAED,SAAS,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE;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ructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","/**\r\n * ====================================================================\r\n * WeLearn Pro Player: Default configuration\r\n * Default configurations with comments. Don't edit this file.\r\n * ====================================================================\r\n */\r\n\r\nconst defaults = {\r\n\r\n // This is a mode for preview video. User metadata, Progression data, Slide, Progress bar will be disabled.\r\n previewMode: false,\r\n\r\n // Set to true if the video is from link.\r\n embedVideo: false,\r\n\r\n // Credential of user\r\n user: '',\r\n\r\n // URL of this video\r\n video: '',\r\n\r\n // URL to thumbnail of the video\r\n thumbnail: '',\r\n\r\n // Determine if this player can be seek.\r\n seekable: true,\r\n\r\n // Debug mode. Show debug log in console.\r\n debug: false,\r\n\r\n // Sync slide with video\r\n slidesync: false,\r\n\r\n // Determine the URL to be Ajax with when update and load video view progress.\r\n progress: {\r\n\r\n // Configuration about how video update its progress to the server.\r\n update: {\r\n\r\n // PHP page URL for update update progress.\r\n url: 'updateURL.php',\r\n\r\n // Update interval (milliseconds)\r\n interval: 20000,\r\n\r\n // Display Bootstrap alert when player failed to update progress.\r\n alert: false,\r\n\r\n // Message that display with alert.\r\n alertMessage: 'Failed to update user\\'s progress. Please refresh to try again or continue'\r\n },\r\n\r\n load: {\r\n\r\n // PHP page URL for load user progress.\r\n url: 'retrieveURL.php',\r\n\r\n // Display Bootstrap alert when player failed to get video progress.\r\n alert: true,\r\n\r\n // Message that display with alert.\r\n alertMessage: 'ไม่สามารถรับค่าความคืบหน้าของวีดิโอได้ โปรด Refresh เพื่อลองใหม่'\r\n }\r\n },\r\n\r\n // Page elements those associate with the plugin\r\n pageElement: {\r\n\r\n // Modal that display video.\r\n videoModal: \"#modalPreviewXL\"\r\n },\r\n\r\n // Note customization\r\n note: {\r\n\r\n // Note retrieval\r\n get: {\r\n\r\n // URL to get note script\r\n url: \"getNote.php\"\r\n },\r\n\r\n // Note saving event\r\n save: {\r\n\r\n // URL to save note script\r\n url: \"updateNote.php\",\r\n\r\n // Display Bootstrap alert when note saved.\r\n alert: false,\r\n\r\n // Text when note saved successfully\r\n successMessage: \"บันทึกข้อความสำเร็จ\",\r\n\r\n // Text when note saved failed\r\n failureMessage: \"บันทึกข้อความไม่สำเร็จ กรุณาลองใหม่อีกครั้ง\",\r\n\r\n // Text when use click note area\r\n instructionMessage: \"พิมพ์ข้อความแล้วกดปุ่ม ENTER เพื่อบันทึกข้อความ...\",\r\n\r\n // Time until message get removed.\r\n messageTimeout: 5000\r\n },\r\n\r\n //Note update event\r\n update: {\r\n\r\n // URL to update note script\r\n url: \"updateNote.php\"\r\n },\r\n\r\n //Note delete event\r\n delete: {\r\n\r\n // URL to delete note script\r\n url: \"deleteNote.php\"\r\n }\r\n },\r\n\r\n // Course batch chat\r\n chat: {\r\n\r\n // Chat get\r\n get: {\r\n\r\n // URL to get chat script\r\n url: \"getChat.php\"\r\n }\r\n },\r\n\r\n // Video quiz\r\n quiz: {\r\n\r\n // Video quiz will be invoke once unless refresh the page\r\n invokeOnce: true\r\n }\r\n};\r\n\r\nexport default defaults;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","// ==========================================================================\r\n// Type checking utils\r\n//\r\n// This module redistributed from the 'is' module of Plyr.js by Sam Potts under the MIT License (MIT)\r\n// ==========================================================================\r\n\r\nconst getConstructor = input => (input !== null && typeof input !== 'undefined' ? input.constructor : null);\r\nconst instanceOf = (input, constructor) => Boolean(input && constructor && input instanceof constructor);\r\nconst isNullOrUndefined = input => input === null || typeof input === 'undefined';\r\nconst isObject = input => getConstructor(input) === Object;\r\nconst isNumber = input => getConstructor(input) === Number && !Number.isNaN(input);\r\nconst isString = input => getConstructor(input) === String;\r\nconst isBoolean = input => getConstructor(input) === Boolean;\r\nconst isFunction = input => getConstructor(input) === Function;\r\nconst isArray = input => Array.isArray(input);\r\nconst isWeakMap = input => instanceOf(input, WeakMap);\r\nconst isNodeList = input => instanceOf(input, NodeList);\r\nconst isElement = input => instanceOf(input, Element);\r\nconst isTextNode = input => getConstructor(input) === Text;\r\nconst isEvent = input => instanceOf(input, Event);\r\nconst isKeyboardEvent = input => instanceOf(input, KeyboardEvent);\r\nconst isCue = input => instanceOf(input, window.TextTrackCue) || instanceOf(input, window.VTTCue);\r\nconst isTrack = input => instanceOf(input, TextTrack) || (!isNullOrUndefined(input) && isString(input.kind));\r\nconst isPromise = input => instanceOf(input, Promise);\r\n\r\nconst isEmpty = input =>\r\n isNullOrUndefined(input) ||\r\n ((isString(input) || isArray(input) || isNodeList(input)) && !input.length) ||\r\n (isObject(input) && !Object.keys(input).length);\r\n\r\nconst isUrl = input => {\r\n // Accept a URL object\r\n if (instanceOf(input, window.URL)) {\r\n return true;\r\n }\r\n\r\n // Must be string from here\r\n if (!isString(input)) {\r\n return false;\r\n }\r\n\r\n // Add the protocol if required\r\n let string = input;\r\n if (!input.startsWith('http://') || !input.startsWith('https://')) {\r\n string = `http://${input}`;\r\n }\r\n\r\n try {\r\n return !isEmpty(new URL(string).hostname);\r\n } catch (e) {\r\n return false;\r\n }\r\n};\r\n\r\nexport default {\r\n nullOrUndefined: isNullOrUndefined,\r\n object: isObject,\r\n number: isNumber,\r\n string: isString,\r\n boolean: isBoolean,\r\n function: isFunction,\r\n array: isArray,\r\n weakMap: isWeakMap,\r\n nodeList: isNodeList,\r\n element: isElement,\r\n textNode: isTextNode,\r\n event: isEvent,\r\n keyboardEvent: isKeyboardEvent,\r\n cue: isCue,\r\n track: isTrack,\r\n promise: isPromise,\r\n url: isUrl,\r\n empty: isEmpty,\r\n};\r\n","// ==========================================================================\r\n// Object utils\r\n//\r\n// This module redistributed from the 'objects.js' module of Plyr.js by Sam Potts under the MIT License (MIT)\r\n// ==========================================================================\r\n\r\nimport is from './isHelper';\r\n\r\n// Clone nested objects\r\nexport function cloneDeep(object) {\r\n return JSON.parse(JSON.stringify(object));\r\n}\r\n\r\n// Get a nested value in an object\r\nexport function getDeep(object, path) {\r\n return path.split('.').reduce((obj, key) => obj && obj[key], object);\r\n}\r\n\r\n// Deep extend destination object with N more objects\r\nexport function extend(target = {}, ...sources) {\r\n if (!sources.length) {\r\n return target;\r\n }\r\n\r\n const source = sources.shift();\r\n\r\n if (!is.object(source)) {\r\n return target;\r\n }\r\n\r\n Object.keys(source).forEach(key => {\r\n if (is.object(source[key])) {\r\n if (!Object.keys(target).includes(key)) {\r\n Object.assign(target, { [key]: {} });\r\n }\r\n\r\n extend(target[key], source[key]);\r\n } else {\r\n Object.assign(target, { [key]: source[key] });\r\n }\r\n });\r\n\r\n return extend(target, ...sources);\r\n}\r\n","// ==========================================================================\r\n// Bootstrap 4 Helpers for WeLearn Pro Player\r\n//\r\n// Copyrights 2019 Wewasanad Co.,Ltd.\r\n// ==========================================================================\r\n\r\n\r\n/**\r\n * Class consists of quick Bootstrap functions designed for WeLearn Pro Player\r\n */\r\nexport default class Bootstrap4Helper {\r\n /**\r\n * Create alert below the video player.\r\n * @param message - Alert message. Can be in normal string format or HTML.\r\n * @param timeout - Time to close alert in seconds.\r\n * @param element - Specify what element that alert will be inserted below (Default: insert below wlpVideo__progress-bar)\r\n */\r\n static invokeAlert(message, timeout, element = '.wlpVideo__progress-bar') {\r\n if ($('#wlpAlert').length) {\r\n $('#wlpAlert').alert('close');\r\n }\r\n\r\n $(element).after(`
${message}
`);\r\n\r\n if (typeof timeout !== 'undefined') {\r\n setTimeout(function () {\r\n $('#wlpAlert').alert('close');\r\n }, timeout);\r\n }\r\n }\r\n}","// ==========================================================================\r\n// Debugger Helper for WeLearn Pro Player\r\n//\r\n// Copyrights 2019 Wewasanad Co.,Ltd.\r\n// ES6-ify from: https://gist.github.com/bgrins/5108712\r\n// This module is based on the 'console.js' module of Plyr.js by Sam Potts under the MIT License (MIT)\r\n// ==========================================================================\r\n\r\n// Blank function for ternary else case\r\nconst noop = () => {\r\n};\r\n\r\n/**\r\n * Class consists debugging utility functions designed for WeLearn Pro Player\r\n */\r\nexport default class Debug {\r\n constructor(enabled = false) {\r\n this.enabled = enabled && window.console;\r\n }\r\n\r\n get log() {\r\n return this.enabled ? Function.prototype.bind.call(console.log, console) : noop;\r\n }\r\n\r\n get warn() {\r\n return this.enabled ? Function.prototype.bind.call(console.warn, console) : noop;\r\n }\r\n\r\n get error() {\r\n return this.enabled ? Function.prototype.bind.call(console.error, console) : noop;\r\n }\r\n}","// =====================================================\r\n// WeLearn Pro Player - Note module\r\n// =====================================================\r\n\r\nexport default class Note {\r\n constructor(player) {\r\n this.player = player;\r\n this.courseSectionModuleId = (function () {\r\n const urlParams = new URLSearchParams(window.location.search);\r\n return urlParams.get('csm');\r\n }());\r\n }\r\n\r\n getNote() {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.note.get.url,\r\n data: {\r\n //VideoId: Number(self.progressData.videoId)\r\n CourseSectionModuleId: Number(this.courseSectionModuleId)\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note retrieval successful\");\r\n }\r\n\r\n $('.ddlmemo-list').addClass('widthOpen');\r\n $('.overlay').addClass('active');\r\n $('.note-detail').remove();\r\n $('li.course-head.note-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note retrieval failed\");\r\n }\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_noteEvent();\r\n }\r\n\r\n /**\r\n * Create note at the current time of video.\r\n * @param time\r\n * @param text\r\n */\r\n createNote(text, time = this.player.plyrPlayer.currentTime) {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.note.save.url,\r\n data: {\r\n //VideoId: Number(self.progressData.videoId),\r\n CourseSectionModuleId: Number(this.courseSectionModuleId),\r\n VideoId: Number(self.progressData.videoId),\r\n Message: text,\r\n Time: Math.floor(time)\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note saved successful\");\r\n }\r\n\r\n $.notify(\"บันทึกข้อความสำเร็จ\", \"success\");\r\n\r\n if ($('#note-result').length) {\r\n $('#note-result').remove();\r\n }\r\n\r\n if (self.options.note.save.alert === true) {\r\n $('#note-area').after(`

${self.options.note.save.successMessage}

`);\r\n\r\n setTimeout(function () {\r\n $('#note-result').remove();\r\n }, self.options.note.save.messageTimeout);\r\n }\r\n\r\n $('#note-area').val(\"\");\r\n\r\n $('.note-detail').remove();\r\n $('li.course-head.note-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note saved failed\");\r\n }\r\n\r\n $.notify(\"บันทึกข้อความผิดพลาด\", \"error\");\r\n\r\n if ($('#note-result').length) {\r\n $('#note-result').remove();\r\n }\r\n\r\n if (self.options.note.save.alert === true) {\r\n $('#note-area').after(`

${self.options.note.save.failureMessage}

`);\r\n\r\n setTimeout(function () {\r\n $('#note-result').remove();\r\n }, self.options.note.save.messageTimeout);\r\n }\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_noteEvent();\r\n }\r\n\r\n updateNote(noteId, message) {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.note.update.url,\r\n data: {\r\n NoteId: noteId,\r\n CourseSectionModuleId: Number(this.courseSectionModuleId),\r\n Message: message\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note edit successful\");\r\n }\r\n\r\n $.notify(\"แก้ไขข้อความสำเร็จ\", \"success\");\r\n\r\n $('.note-detail').remove();\r\n $('li.course-head.note-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note edit failed\");\r\n }\r\n\r\n $.notify(\"แก้ไขข้อความผิดพลาด\", \"error\");\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_noteEvent();\r\n }\r\n\r\n deleteNote(noteId) {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.note.delete.url,\r\n data: {\r\n NoteId: noteId,\r\n CourseSectionModuleId: Number(this.courseSectionModuleId)\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note edit successful\");\r\n }\r\n\r\n $.notify(\"ลบข้อความสำเร็จ\", \"success\");\r\n\r\n $('.note-detail').remove();\r\n $('li.course-head.note-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Note edit failed\");\r\n }\r\n\r\n $.notify(\"ลบข้อความผิดพลาด\", \"error\");\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_noteEvent();\r\n }\r\n\r\n /**\r\n * Seek video to specific time.\r\n * @param time - Time of video.\r\n * @param useSeekableOption - Apply 'seekable' rule from video option.\r\n */\r\n seekTo(time, useSeekableOption = false) {\r\n let self = this.player;\r\n\r\n if (useSeekableOption) {\r\n switch (self.options.seekable) {\r\n case true:\r\n self.plyrPlayer.currentTime = time;\r\n return true;\r\n\r\n case false: // TODO : Quick changes by changing Seekable: false behavior from complete unseekable -> seekable only watched\r\n let barTime = Math.floor(time);\r\n if ($(`span.tick[data-timestamp='${barTime}']`).hasClass('watched') || (barTime === 0)) {\r\n self.plyrPlayer.currentTime = time;\r\n return true;\r\n } else {\r\n //self.invokeAlert('ขออภัย คุณสามารถกรอได้เฉพาะส่วนที่ดูไปแล้ว', 3000);\r\n self.invokeAlert($.i18n(\"seekWatched\"), 3000);\r\n return false;\r\n }\r\n\r\n default:\r\n //self.invokeAlert('ขออภัย วิดีโอนี้ถูกตั้งค่าให้ไม่สามารถกรอวิดีโอได้', 3000);\r\n self.invokeAlert($.i18n('seekDisallowed'), 3000);\r\n return false;\r\n }\r\n } else {\r\n self.plyrPlayer.currentTime = time;\r\n return true;\r\n }\r\n }\r\n}\r\n","// =====================================================\r\n// WeLearn Pro Player - Caption module\r\n// =====================================================\r\n\r\nexport default class Caption {\r\n constructor(player) {\r\n this.player = player\r\n }\r\n\r\n /**\r\n * Add caption to video (Must be load before the player finished initialize)\r\n * @param label - Language name\r\n * @param srclang - Language abbreviation\r\n * @param src - Caption file path\r\n * @param setDefault - Set to true if this language is default language or vice versa\r\n */\r\n addCaption(label, srclang, src, setDefault = false) {\r\n $(this.player.element).append('' +\r\n ``)\r\n }\r\n}\r\n","// =====================================================\r\n// WeLearn Pro Player - Slide module\r\n// =====================================================\r\n\r\nexport default class Slide {\r\n constructor(player) {\r\n this.player = player;\r\n }\r\n\r\n /**\r\n * Check initialized sync state to determine if the plugin should sync or unsync slide\r\n */\r\n checkSyncState() {\r\n return this.player.options.syncSlide ? this.syncSlide() : this.unsyncSlide();\r\n }\r\n\r\n /**\r\n * Sync slide\r\n * @returns {boolean} - Sync state\r\n */\r\n syncSlide() {\r\n $('.carousel-control-next').css({ 'pointer-events': 'none', 'display': 'none' });\r\n $('.carousel-control-prev').css({ 'pointer-events': 'none', 'display': 'none' });\r\n\r\n $('.wlpVideo__sync').css({ color: '#10d000' });\r\n return true;\r\n }\r\n\r\n /**\r\n * Unsync slide\r\n * @returns {boolean} - Unsync state\r\n */\r\n unsyncSlide() {\r\n $('.carousel-control-next').css({ 'pointer-events': 'auto', 'display': 'flex' });\r\n $('.carousel-control-prev').css({ 'pointer-events': 'auto', 'display': 'flex' });\r\n $('.wlpVideo__sync').css({ color: '#ffffff' });\r\n return false;\r\n }\r\n\r\n /**\r\n * Change slide page to specify page.\r\n * @param slidePage - Slide page to change to.\r\n */\r\n changeSlidePage(slidePage) {\r\n let fancybox = $.fancybox.getInstance();\r\n $('#wlpVideo_slide').carousel(slidePage);\r\n\r\n if (fancybox) {\r\n fancybox.jumpTo(slidePage);\r\n }\r\n }\r\n}","import Debug from './util/debugHelper';\r\n\r\nexport default class Exception {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player);\r\n }\r\n\r\n videoNotFound() {\r\n if ($(this.player.element).length === 0) {\r\n this.debug.error(\"ERROR: Video not found.\");\r\n return false;\r\n }\r\n }\r\n\r\n captionNotFound() {\r\n if ($(this.player.element).find(\"track\").length === 0) {\r\n this.debug.error(\"ERROR: Caption not found.\");\r\n return false;\r\n }\r\n }\r\n}","// =====================================================\r\n// Hide-YT module\r\n// This is a modified version of Hide-YT script by Maximillian Laumeister into an ES6 module\r\n// For more information: https://maxl.us/hideyt\r\n// =====================================================\r\n\r\n\"use strict\";\r\n\r\nconst HideYt =\r\n document.addEventListener('DOMContentLoaded', function () {\r\n // Activate only if not already activated\r\n if (window.hideYTActivated) return;\r\n // Activate on all players\r\n let onYouTubeIframeAPIReadyCallbacks = [];\r\n for (let playerWrap of document.querySelectorAll(\".hytPlayerWrap\")) {\r\n let playerFrame = playerWrap.querySelector(\"iframe\");\r\n\r\n let tag = document.createElement('script');\r\n tag.src = \"https://www.youtube.com/iframe_api\";\r\n let firstScriptTag = document.getElementsByTagName('script')[0];\r\n console.log(document.getElementsByTagName('script'));\r\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\r\n\r\n let onPlayerStateChange = function (event) {\r\n if (event.data == YT.PlayerState.ENDED) {\r\n playerWrap.classList.add(\"ended\");\r\n } else if (event.data == YT.PlayerState.PAUSED) {\r\n playerWrap.classList.add(\"paused\");\r\n } else if (event.data == YT.PlayerState.PLAYING) {\r\n playerWrap.classList.remove(\"ended\");\r\n playerWrap.classList.remove(\"paused\");\r\n }\r\n };\r\n\r\n let player;\r\n\r\n onYouTubeIframeAPIReadyCallbacks.push(function () {\r\n player = new YT.Player(playerFrame, {\r\n events: {\r\n 'onStateChange': onPlayerStateChange\r\n }\r\n });\r\n });\r\n\r\n playerWrap.addEventListener(\"click\", function () {\r\n let playerState = player.getPlayerState();\r\n if (playerState == YT.PlayerState.ENDED) {\r\n player.seekTo(0);\r\n } else if (playerState == YT.PlayerState.PAUSED) {\r\n player.playVideo();\r\n }\r\n });\r\n }\r\n\r\n window.onYouTubeIframeAPIReady = function () {\r\n for (let callback of onYouTubeIframeAPIReadyCallbacks) {\r\n callback();\r\n }\r\n };\r\n\r\n window.hideYTActivated = true;\r\n });\r\n\r\nexport default HideYt;","// =====================================================\r\n// WeLearn Pro Player - Loader module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper.js';\r\nimport Caption from './caption';\r\nimport Bootstrap4Helper from './util/bootstrapHelper'\r\nimport Exception from './exception';\r\nimport HideYt from './util/hide-yt'\r\n\r\nexport default class Loader {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player.options.debug);\r\n this.exception = new Exception(this.player);\r\n this.HideYt = HideYt;\r\n\r\n this.caption = new Caption(this.player);\r\n }\r\n\r\n /**\r\n * Initialize WeLearn Pro Player.\r\n */\r\n initVideo() {\r\n if (this.player.options.embedVideo === true) {\r\n this.loadEmbedVideo(this.player.options.video);\r\n } else {\r\n this.loadVideoSources(this.player.options.video, this.player.options.thumbnail);\r\n }\r\n\r\n $.i18n().load({\r\n 'en-US': '/Scripts/welearnpro-player/i18n/en.json',\r\n 'th-TH': '/Scripts/welearnpro-player/i18n/th.json'\r\n });\r\n\r\n /*if (this.player.options.previewMode === false)\r\n {*/\r\n this.loadCaptions();\r\n //}\r\n }\r\n\r\n /**\r\n * Load video from the player option\r\n * @param url - Video URL\r\n * @param thumbnail - Video thumbnail\r\n */\r\n loadVideoSources(url = this.player.options.video, thumbnail = this.player.options.thumbnail) {\r\n let videoPlayer = $(this.player.element);\r\n\r\n videoPlayer.attr(\"src\", url);\r\n videoPlayer.attr(\"poster\", thumbnail);\r\n\r\n this.debug.log('Video source loaded');\r\n }\r\n\r\n loadEmbedVideo(url = this.player.options.video) {\r\n // Convert video element into youtube div\r\n if (this.player.options.embedVideo) {\r\n this.convertVideoToEmbedded();\r\n }\r\n this.debug.log('Embed video source loaded');\r\n }\r\n\r\n convertVideoToEmbedded() {\r\n let videoPlayer = $(this.player.element);\r\n let videoPlayerElementName = videoPlayer.get(0).id;\r\n\r\n videoPlayer.replaceWith(`
`);\r\n\r\n let origin = window.location.origin;\r\n let source = `${this.player.options.video}?origin=${origin}&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1`;\r\n\r\n $('#' + videoPlayerElementName).append(``);\r\n }\r\n\r\n /**\r\n * Load user's watch progress data.\r\n */\r\n loadVideoData(userId) {\r\n let self = this;\r\n\r\n let videoId = self.player.progressData.videoId;\r\n\r\n this.debug.log({ userId: userId, videoId: videoId });\r\n\r\n if ((userId) && (videoId)) {\r\n self.loadWatchedProgress();\r\n self.loadQuizs();\r\n /*self.loadNotes();\r\n self.loadSlides();*/\r\n } else {\r\n if (self.player.options.progress.load.alert === true) {\r\n Bootstrap4Helper.invokeAlert(self.player.options.progress.load.alertMessage, 5000, '.wlpVideo__progress-bar');\r\n }\r\n }\r\n\r\n /*$.ajax({\r\n url: self.player.options.progress.load.url,\r\n data: {\r\n userId : userId,\r\n videoId : this.player.progressData.videoId\r\n },\r\n type: 'post',\r\n success: function(result)\r\n {\r\n self.loadWatchedProgress();\r\n self.loadQuizs();\r\n self.loadNotes();\r\n self.loadSlides();\r\n },\r\n error: function(result)\r\n {\r\n if (self.player.options.progress.load.alert === true)\r\n {\r\n Bootstrap4Helper.invokeAlert(self.player.options.progress.load.alertMessage, 5000, '.wlpVideo__progress-bar');\r\n }\r\n }\r\n });*/\r\n }\r\n\r\n loadWatchedProgress() {\r\n if (this.player.progressData['timestamp']) {\r\n if (self.options.debug === true) {\r\n console.log('DEBUG: Video data object: ');\r\n console.log(this.player.progressData['timestamp']);\r\n }\r\n\r\n for (let i = 0; i < Object.values(this.player.progressData['timestamp']).length; i++) {\r\n $('.tick[data-timestamp=' + this.player.progressData['timestamp'][i] + ']').addClass('watched').addClass('saved');\r\n }\r\n }\r\n }\r\n\r\n loadQuizs() {\r\n for (let i = 0; i < Object.values(this.player.videoComponent['quiz']).length; i++) {\r\n $('.tick[data-timestamp=' + this.player.videoComponent['quiz'][i]['time'] + ']').attr(\"data-quiz\", this.player.videoComponent['quiz'][i]['quizId']);\r\n $('.tick[data-timestamp=' + this.player.videoComponent['quiz'][i]['time'] + ']').attr(\"data-csm\", this.player.videoComponent['quiz'][i]['quizCourseSectionModuleId']);\r\n $('.tick[data-timestamp=' + this.player.videoComponent['quiz'][i]['time'] + ']').addClass('test');\r\n }\r\n }\r\n\r\n loadNotes() {\r\n for (let i = 0; i < Object.values(this.player.progressData['note']).length; i++) {\r\n $('.tick[data-note=' + this.player.progressData['note'][i]['time'] + ']').addClass('note');\r\n }\r\n }\r\n\r\n loadSlides() {\r\n for (let i = 0; i < Object.values(this.player.progressData['slide']).length; i++) {\r\n $('.tick[data-slide=' + this.player.progressData['slide']['page'][i]['time'] + ']').addClass('slide');\r\n }\r\n }\r\n\r\n loadCaptions() {\r\n let captions = this.player.videoComponent.caption;\r\n if (captions && captions.length) {\r\n // Add captions (If exists);\r\n for (let i = 0; i < captions.length; i++) {\r\n this.caption.addCaption(captions[i][\"label\"], captions[i][\"srclang\"], captions[i][\"src\"], captions[i][\"default\"]);\r\n }\r\n }\r\n }\r\n\r\n parseProgressBar() {\r\n // Parse slide data from slide object\r\n for (let i = 0; i < this.player.progressData.slide.pages.length; i++) {\r\n $(`span.tick[data-timestamp='${this.player.progressData.slide.pages[i].time}']`).attr('data-page', this.player.progressData.slide.pages[i].page);\r\n }\r\n\r\n // Parse note data from note object\r\n for (let i = 0; i < this.player.progressData.note.length; i++) {\r\n $(`span.tick[data-timestamp='${this.player.progressData.note[i].time}']`).attr('data-note', this.player.progressData.note[i].noteId);\r\n }\r\n\r\n // Parse test data from test object\r\n for (let i = 0; i < this.player.progressData.note.length; i++) {\r\n $(`span.tick[data-timestamp='${this.player.progressData.test[i].time}']`).attr('data-test', this.player.progressData.test[i].testId);\r\n }\r\n }\r\n}","// ==========================================================================\r\n// Data Conversion Helpers\r\n//\r\n// Copyrights 2019 Wewasanad Co.,Ltd.\r\n// ==========================================================================\r\n\r\n/**\r\n * The class consists a series of data conversion into different formats.\r\n */\r\nexport default class Convert {\r\n /**\r\n * Convert time in seconds into timestamp format (hh:mm:ss)\r\n * @param seconds - Time in seconds\r\n * @returns {string} - Timestamp string (hh:mm:ss)\r\n */\r\n static toTimestamp(seconds) {\r\n let d = Number(seconds);\r\n\r\n let h = Math.floor(d / 3600);\r\n let m = Math.floor(d % 3600 / 60);\r\n let s = Math.floor(d % 3600 % 60);\r\n\r\n return ('0' + h).slice(-2) + \":\" + ('0' + m).slice(-2) + \":\" + ('0' + s).slice(-2);\r\n }\r\n}","// =====================================================\r\n// WeLearn Pro Player - UI module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper.js';\r\nimport Convert from './util/conversionHelper';\r\n\r\nexport default class UI {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player.options.debug);\r\n }\r\n\r\n bindWlpPlayer() {\r\n // Declare a WeLearn Pro Player selector\r\n let plyrElement = $(document).find('.plyr');\r\n\r\n // Apply wlpPlayer element for CSS\r\n plyrElement.addClass('wlpPlayer');\r\n\r\n if (this.player.options.previewMode === false) {\r\n this._renderProgressBar();\r\n this._seekablePlyrProgressBar(this.player.options.seekable);\r\n }\r\n }\r\n\r\n _renderProgressBar() {\r\n // Declare a WeLearn Pro Player selector\r\n let plyrElement = $(document).find('.plyr');\r\n\r\n // Create progress bar\r\n plyrElement.after(\r\n \"
\"\r\n );\r\n\r\n var videoDuration;\r\n\r\n if (plyrElement.length !== 0) {\r\n videoDuration = Math.floor(this.player.plyrPlayer.duration); // TODO: Quick fix progress bar render span incorrectly by render extra 1 span\r\n } else {\r\n videoDuration = 1;\r\n }\r\n\r\n for (let i = 1; i <= videoDuration; i++) {\r\n $('.wlpVideo__progress-bar').append(\r\n \"\"\r\n );\r\n }\r\n\r\n $('[data-toggle=\"tooltip\"]').tooltip({\r\n template: '
'\r\n });\r\n }\r\n\r\n /**\r\n * Set this video can be seek or not.\r\n * @param canSeek - true and false\r\n */\r\n _seekablePlyrProgressBar(canSeek) {\r\n if (canSeek === true) {\r\n $('.plyr__progress').css({ 'pointer-events': 'auto' });\r\n return true;\r\n } else {\r\n //$('.plyr__progress').css('pointer-events', 'none');\r\n $('.plyr__progress').css('pointer-events', 'auto');\r\n return false;\r\n }\r\n }\r\n}\r\n","// =====================================================\r\n// WeLearn Pro Player - Progression module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper';\r\n//import Swal from 'sweetalert2';\r\n//import { formatResultsErrors } from 'jest-message-util';\r\n\r\nexport default class Progress {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player.options.debug);\r\n }\r\n\r\n /**\r\n * Build video progress data\r\n * @returns {*} - Video progress data\r\n */\r\n buildProgressData() {\r\n // Clear old timestamp data\r\n this.player.progressData.timestamp = [];\r\n\r\n // Save 'this' reference to use within jQuery scope.\r\n let self = this;\r\n\r\n // Iterate through data-timestamp span\r\n $('span.tick.watched[data-timestamp]').each(function () {\r\n self.player.progressData['timestamp'].push(($(this).attr('data-timestamp')));\r\n });\r\n\r\n self.player.progressData.progress = self.player.progressPercentage;\r\n\r\n // Debug console log\r\n if (this.player.options.debug === true) {\r\n if (Math.floor(self.player.plyrPlayer.currentTime) !== 0) {\r\n this.debug.log('***** Built watch progress data *****');\r\n this.debug.log(self.player.progressData);\r\n this.debug.log('*************************************');\r\n }\r\n }\r\n\r\n return this.player.progressData;\r\n }\r\n\r\n /**\r\n * Update video progress periodically\r\n * @param data - Progress data\r\n */\r\n updateVideoData(progressData) {\r\n let self = this;\r\n const urlParams = new URLSearchParams(window.location.search);\r\n\r\n try {\r\n let cid = self.player.progressData.courseId;\r\n let csm = urlParams.get('csm');\r\n let cb = self.player.progressData.courseBatchId;\r\n let jqXhr = $.ajax({\r\n url: self.player.options.progress.update.url,\r\n data: {\r\n courseId: cid,\r\n courseSectionModuleId: csm,\r\n cb: cb,\r\n progressData: JSON.stringify(progressData)\r\n },\r\n async: true,\r\n type: 'post',\r\n });\r\n\r\n jqXhr.always(function () {\r\n let statusCode = jqXhr.status;\r\n let specialResponse = JSON.parse(jqXhr.getResponseHeader('X-Responded-JSON'));\r\n let isSentWithoutIssue = (specialResponse === null) && (statusCode === 200);\r\n let isAlertEnabled = self.player.options.progress.update.alert === true;\r\n\r\n if (isSentWithoutIssue) {\r\n $('div.wlpVideo__progress-bar > .tick.watched').addClass('saved');\r\n if (self.player.options.debug === true) {\r\n console.log('DEBUG: Student progress successfully saved.');\r\n }\r\n } else {\r\n $('div.wlpVideo__progress-bar > .tick.watched').addClass('error');\r\n\r\n if (isAlertEnabled) {\r\n if (specialResponse.status === 401) {\r\n // self.player.invokeAlert($.i18n('ErrorPleaseLogin'));\r\n Swal.fire({\r\n type: 'error',\r\n title: 'Error!',\r\n text: $.i18n('ErrorPleaseLogin'),\r\n }).then((result) => {\r\n if (result.value) {\r\n window.location.href = '/Account/Login?ReturnUrl=' + encodeURIComponent('/Home/CourseDetail/' + cid + '?cb=' + cb);\r\n }\r\n })\r\n return;\r\n }\r\n\r\n //self.player.invokeAlert(self.player.options.progress.update.alertMessage);\r\n self.player.invokeAlert($.i18n('ErrorUpdateProgress'))\r\n return;\r\n }\r\n }\r\n });\r\n } catch (e) {\r\n $('div.wlpVideo__progress-bar > .tick.watched').addClass('error');\r\n this.debug.log('DEBUG: Student progress cannot be saved :: ' + e);\r\n }\r\n\r\n }\r\n}\r\n","// =====================================================\r\n// WeLearn Pro Player - Quiz module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper';\r\nimport Progress from \"./progress\";\r\n\r\nconst QuizFlags = Object.freeze({\r\n finished: Symbol('finished'),\r\n unfinished: Symbol('unfinished')\r\n});\r\n\r\nexport default class Quiz {\r\n constructor(player) {\r\n this.player = player;\r\n this.progress = new Progress(this.player);\r\n this.debug = new Debug(this.player.options.debug);\r\n }\r\n\r\n /**\r\n * Invoke quiz by quiz ID.\r\n * @param quizId - Quiz ID\r\n */\r\n invokeQuiz(quizId, quizCourseSectionModuleId) {\r\n let self = this;\r\n\r\n self.player.progressData = this.progress.buildProgressData();\r\n self.progress.updateVideoData(self.player.progressData);\r\n\r\n $.ajax({\r\n url: '/Learning/QuizRedirect/',\r\n data: {\r\n courseId: self.player.progressData.courseId,\r\n csm: quizCourseSectionModuleId, // Note: csm of QUIZ NOT VIDEO!\r\n quizId: quizId,\r\n seekable: self.player.options.seekable,\r\n vid: self.player.videoComponent.videoId,\r\n cb: self.player.progressData.courseBatchId,\r\n cs: self.player.progressData.courseSectionId,\r\n vidcsm: self.player.progressData.courseSectionModuleId\r\n },\r\n type: 'get',\r\n success: function (result) {\r\n if (result !== \"pass\") {\r\n self.player.plyrPlayer.pause();\r\n\r\n $(\"#video-quiz-redirect-container\").html(result);\r\n $('#video-quiz-redirect').modal({\r\n backdrop: 'static',\r\n keyboard: false\r\n });\r\n $('#video-quiz-redirect').modal('show');\r\n }\r\n\r\n return true;\r\n },\r\n error: function (result) {\r\n return false;\r\n }\r\n });\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Unload quiz and unhide course video\r\n */\r\n unloadQuiz() {\r\n let self = this;\r\n\r\n if ($('#quiz-learning').length) {\r\n $('#quiz-learning').remove();\r\n $('#course-lrn').show();\r\n self._enableNavigations();\r\n }\r\n }\r\n\r\n _disableNavigations() {\r\n $('#ddlchat').css({ 'opacity': '0.5', 'pointer-events': 'none' });\r\n $('#ddlcourse').css({ 'opacity': '0.5', 'pointer-events': 'none' });\r\n $('#ddldownload').css({ 'opacity': '0.5', 'pointer-events': 'none' });\r\n $('#ddlmemo').css({ 'opacity': '0.5', 'pointer-events': 'none' });\r\n }\r\n\r\n _enableNavigations() {\r\n $('#ddlchat').css({ 'opacity': '1', 'pointer-events': 'auto' });\r\n $('#ddlcourse').css({ 'opacity': '1', 'pointer-events': 'auto' });\r\n $('#ddldownload').css({ 'opacity': '1', 'pointer-events': 'auto' });\r\n $('#ddlmemo').css({ 'opacity': '1', 'pointer-events': 'auto' });\r\n }\r\n\r\n _flag(flag, time) {\r\n switch (flag) {\r\n case (QuizFlags.finished):\r\n $(`span.tick[data-timestamp=${time}]`).addClass('finished-test');\r\n return true;\r\n\r\n case (QuizFlags.unfinished):\r\n $(`span.tick[data-timestamp=${time}]`).addClass('unfinished-test');\r\n return true;\r\n\r\n default:\r\n return false;\r\n }\r\n }\r\n}","function _typeof2(obj) { if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof2(obj); }\n\nfunction _typeof(obj) {\n if (typeof Symbol === \"function\" && _typeof2(Symbol.iterator) === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return _typeof2(obj);\n };\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : _typeof2(obj);\n };\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;","function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;","function _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;","var arrayWithHoles = require(\"./arrayWithHoles\");\n\nvar iterableToArrayLimit = require(\"./iterableToArrayLimit\");\n\nvar nonIterableRest = require(\"./nonIterableRest\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;","// =====================================================\r\n// WeLearn Pro Player - Option module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper';\r\n\r\nexport default class urlOptions {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player.options.debug);\r\n }\r\n\r\n getOptionsFromUrl() {\r\n // Get special command from query strings\r\n const search = window.location.search;\r\n const params = new URLSearchParams(search);\r\n let paramObj = {};\r\n\r\n for (var value of params.keys()) {\r\n paramObj[value] = params.get(value);\r\n }\r\n\r\n return paramObj;\r\n }\r\n\r\n applyOption(option, value) {\r\n switch (option) {\r\n case \"startat\":\r\n this.player.plyrPlayer.currentTime = Number(value);\r\n break;\r\n case \"autoplay\":\r\n if (value == 1) {\r\n const playPromise = this.player.plyrPlayer.play();\r\n\r\n if (playPromise.length) {\r\n playPromise.catch(() => {\r\n this.player.plyrPlayer.play();\r\n });\r\n }\r\n }\r\n default:\r\n break;\r\n }\r\n }\r\n}","// =====================================================\r\n// WeLearn Pro Player - Event module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper';\r\nimport UI from './ui';\r\nimport Quiz from './quiz';\r\nimport Loader from './loader';\r\nimport Progress from './progress';\r\nimport urlOptions from './options';\r\nimport slide from \"./slide\";\r\n\r\nexport default class Events {\r\n constructor(player) {\r\n this.player = player;\r\n this.previousQuiz = 0;\r\n this.debug = new Debug(this.player.options.debug);\r\n\r\n this._bindEvents();\r\n\r\n this.ui = new UI(this.player);\r\n this.quiz = new Quiz(this.player);\r\n this.loader = new Loader(this.player);\r\n this.progress = new Progress(this.player);\r\n this.urlOptions = new urlOptions(this.player);\r\n }\r\n\r\n _bindEvents() {\r\n $(document).ready((e) => {\r\n this._bind_listeners();\r\n this._bind_documentready();\r\n this._bind_onloadeddata();\r\n this._bind_timeupdate();\r\n this._bind_noteEvent();\r\n this._bind_chatEvent();\r\n });\r\n }\r\n\r\n _bind_listeners() {\r\n let self = this;\r\n let wlp = this.player;\r\n let plyr = this.player.plyrPlayer;\r\n\r\n plyr.config.listeners.seek = function disableSeekForUnseekablePlayer (e) {\r\n if (!wlp.options.seekable) {\r\n let currentTime = plyr.currentTime;\r\n let newTime = self._getTargetTime(plyr, e);\r\n\r\n Object.defineProperty(event, \"defaultPrevented\", {\r\n value: event.defaultPrevented,\r\n writable: true\r\n });\r\n\r\n event.preventDefault = () => {\r\n event.defaultPrevented = true;\r\n };\r\n\r\n if ((newTime > currentTime) || (newTime < currentTime)) {\r\n e.preventDefault();\r\n wlp.seekTo(newTime, true);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n }\r\n\r\n _bind_documentready() {\r\n let self = this;\r\n\r\n $(document).on('click', 'span.tick', function () {\r\n let timeToForward = $(this).data('timestamp');\r\n self.player.seekTo(timeToForward, true);\r\n });\r\n\r\n $(window).on(\"beforeunload\", event => {\r\n if (this.player.options.previewMode === false) {\r\n this.player.progressData = this.progress.buildProgressData();\r\n this.progress.updateVideoData(this.player.progressData);\r\n }\r\n });\r\n }\r\n\r\n _bind_chatEvent() {\r\n let self = this;\r\n\r\n $('#ddlchat').off().on('click', function (e) {\r\n self.player.chat.getChat();\r\n });\r\n\r\n /*$('a.btn.btn-main-theme.btn-submit-reply').off().on('click', function (e)\r\n {\r\n let courseChatQuestionId = $(e.target).attr('name');\r\n\r\n if ($('#comment-box-' + courseChatQuestionId).val().length)\r\n {\r\n self.player.chat.createAnswer(courseChatQuestionId, $('#comment-box-' + courseChatQuestionId).val());\r\n }\r\n });*/\r\n\r\n /*$('button.btn.btn-main-theme.btn-submit-question').off().on('click', function (e)\r\n {\r\n if ($('#chatQuestion_Message').val().length)\r\n {\r\n self.player.chat.createQuestion($('#chatQuestion_Message').val());\r\n $('#chatQuestion_Message').val(\"\");\r\n }\r\n });*/\r\n }\r\n\r\n _bind_noteEvent() {\r\n let self = this;\r\n\r\n $('#ddlmemo').off().on('click', function (e) {\r\n self.player.note.getNote();\r\n });\r\n\r\n $('#note-area').off().on('keypress', function (e) {\r\n let noteArea = $(this);\r\n\r\n if (e.which === 13 || e.keyCode === 13) {\r\n if (noteArea.val().length) {\r\n if (wlpVideo.createNote(noteArea.val(), wlpVideo.plyrPlayer.currentTime)) {\r\n noteArea.val(\"\");\r\n noteArea.blur();\r\n } else {\r\n e.preventDefault();\r\n }\r\n } else {\r\n noteArea.notify(\"กรุณากรอกข้อความ\", \"error\");\r\n }\r\n }\r\n });\r\n\r\n $('a.btn-main-grey.btn-note-edit').off().on('click', function (e) {\r\n let noteId = $(e.target).attr('name');\r\n\r\n let oldText = $('li.note-detail#note-' + noteId).find('font.memo-message').text();\r\n\r\n $('li.note-detail#note-' + noteId).find('font.memo-message').replaceWith('');\r\n\r\n $('.div-note-menu[data-note-id=\"' + noteId + '\"]').css(\"display\", \"none\");\r\n $('.div-note-save[data-note-id=\"' + noteId + '\"]').css(\"display\", \"block\");\r\n\r\n $(\".btn-note-save[data-nid='\" + noteId + \"']\").on(\"click\", function (e) {\r\n self.player.note.updateNote(noteId, $('#note-edit[name=' + noteId + ']').val());\r\n });\r\n\r\n $(\".btn-note-cancel[data-nid='\" + noteId + \"']\").on(\"click\", function (e) {\r\n self.player.note.getNote();\r\n });\r\n\r\n $('#note-edit[name=' + noteId + ']').bind('keyup', function (e) {\r\n e.preventDefault();\r\n\r\n switch (e.key) {\r\n case 'Enter':\r\n if ($(this).val().length) {\r\n self.player.note.updateNote(noteId, $(this).val());\r\n } else {\r\n $(this).notify(\"กรุณากรอกข้อความ\", \"error\");\r\n }\r\n break;\r\n\r\n case 'Escape':\r\n self.player.note.getNote();\r\n\r\n break;\r\n }\r\n });\r\n });\r\n\r\n /*$('a.btn-main-grey.btn-note-remove').off().on('click', function (e) {\r\n let noteId = $(e.target).attr('name');\r\n\r\n self.player.note.deleteNote(noteId);\r\n });*/\r\n }\r\n\r\n _bind_onloadeddata() {\r\n let self = this;\r\n let updateRepeater = {};\r\n let initEvent = '';\r\n\r\n if (this.player.options.embedVideo === true) {\r\n initEvent = \"ready\"\r\n } else {\r\n initEvent = \"loadeddata\";\r\n }\r\n\r\n this.player.plyrPlayer.on(\"pause\", event => {\r\n if (this.player.options.previewMode === false) {\r\n this.player.progressData = this.progress.buildProgressData();\r\n this.progress.updateVideoData(this.player.progressData);\r\n }\r\n });\r\n\r\n this.player.plyrPlayer.on(\"ended\", event => {\r\n if (this.player.options.previewMode === false) {\r\n this.player.progressData = this.progress.buildProgressData();\r\n this.progress.updateVideoData(this.player.progressData);\r\n }\r\n });\r\n\r\n this.player.plyrPlayer.on(initEvent, event => {\r\n // Wrap WeLearn Pro Player to Plyr instance.\r\n this.ui.bindWlpPlayer();\r\n\r\n // If video player is NOT in Preview Mode, load these:\r\n if (this.player.options.previewMode === false) {\r\n // Load user's video progress and test\r\n this.loader.loadVideoData(this.player.progressData.userId);\r\n\r\n // Parse slide data from slide object\r\n if (this.player.videoComponent.slide !== undefined) {\r\n for (let i = 0; i < this.player.videoComponent.slide.length; i++) {\r\n $(`span.tick[data-timestamp='${this.player.videoComponent.slide[i].time}']`).attr('data-page', this.player.videoComponent.slide[i].page);\r\n }\r\n }\r\n\r\n // Parse note data from note object\r\n if (this.player.progressData.note !== undefined) {\r\n for (let i = 0; i < this.player.progressData.note.length; i++) {\r\n $(`span.tick[data-timestamp='${this.player.progressData.note[i].time}']`).attr('data-note', this.player.progressData.note[i].noteId);\r\n }\r\n\r\n // Parse test data from test object\r\n //for (let i = 0; i < this.player.progressData.note.length; i++)\r\n //{\r\n // $(`span.tick[data-timestamp='${this.player.progressData.test[i].time}']`).attr('data-test', this.player.progressData.test[i].testId);\r\n //}\r\n //for (let i = 0; i < this.player.videoComponent.quiz.length; i++)\r\n //{\r\n // $(`span.tick[data-timestamp='${this.player.progressData.quiz[i].time}']`).attr('data-test', this.player.progressData.quiz[i].quizId);\r\n // $(`span.tick[data-timestamp='${this.player.progressData.quiz[i].time}']`).attr('data-csm', this.player.progressData.quiz[i].quizCourseSectionModuleId);\r\n //}\r\n }\r\n\r\n // Start saving video progress after all things ready to use.\r\n updateRepeater = setInterval(() => {\r\n if (this.player.plyrPlayer.playing) //Only update if video is playing\r\n {\r\n this.player.progressData = this.progress.buildProgressData();\r\n this.progress.updateVideoData(this.player.progressData);\r\n }\r\n },\r\n this.player.options.progress.update.interval\r\n );\r\n }\r\n\r\n // Apply option from URL\r\n const urlOptions = this.urlOptions.getOptionsFromUrl();\r\n for (let [command, value] of Object.entries(urlOptions)) {\r\n this.urlOptions.applyOption(command, value);\r\n }\r\n });\r\n }\r\n\r\n _getTargetTime(plyr, input) {\r\n if (\r\n typeof input === \"object\" &&\r\n (input.type === \"input\" || input.type === \"change\")\r\n ) {\r\n return input.target.value / input.target.max * plyr.media.duration;\r\n } else {\r\n return Number(input);\r\n }\r\n }\r\n\r\n _bind_timeupdate() {\r\n let self = this;\r\n\r\n this.player.plyrPlayer.on('loadeddata', event => {\r\n this.player.plyrPlayer.currentTime = 0; // Temp fix for volumn slider not showing unless manually seek\r\n });\r\n\r\n this.player.plyrPlayer.on('timeupdate', event => {\r\n let currentTimestamp = Math.floor(this.player.plyrPlayer.currentTime);\r\n // Add watched class to watched second\r\n $('.tick[data-timestamp=' + currentTimestamp + ']').addClass('watched');\r\n\r\n // TODO: Slide correction function. (Need optimization)\r\n let isSyncSlideEnabled = self.player.syncSlide;\r\n let hasSlide = self.player.videoComponent.slide;\r\n\r\n if (hasSlide && isSyncSlideEnabled) {\r\n (function slideSync() {\r\n let slideData = self.player.videoComponent.slide;\r\n let currentSlide = (function () {\r\n let previousSlides = slideData.filter(({ time }) => {\r\n return time <= currentTimestamp;\r\n });\r\n return previousSlides.pop();\r\n })();\r\n\r\n if (currentSlide !== undefined) {\r\n self.player.changeSlidePage(currentSlide.page);\r\n }\r\n })();\r\n }\r\n\r\n {\r\n /*let slideData = self.player.videoComponent.slide;\r\n let closestSlide = slideData.reduce(function (prev, curr) {\r\n return (Math.abs(curr - slideData.page) < Math.abs(prev - slideData.page) ? curr :prev);\r\n });\r\n console.log(closestSlide);*/\r\n\r\n /*if (aheadSlide !== undefined) {\r\n self.player.changeSlidePage(aheadSlide.page);\r\n }*/\r\n\r\n // Sync slide functionality\r\n // TODO: Intentionally turn this of in favor of new sync slide event in ontimeupdate event\r\n /*if (this.player.syncSlide) {\r\n let pageToChange = $(`.tick[data-timestamp='${currentTimestamp}']`).data('page');\r\n if (pageToChange) {\r\n this.player.changeSlidePage(pageToChange);\r\n }\r\n //self.player.changeSlidePage(aheadSlide.page);\r\n }*/\r\n }\r\n\r\n let isHasQuiz = $(`span.tick[data-timestamp=${currentTimestamp}]`).data('quiz');\r\n if (isHasQuiz === undefined) {\r\n self.previousQuiz = 0;\r\n }\r\n let isAlreadyInvoked = (isHasQuiz === self.previousQuiz);\r\n\r\n {\r\n /*self.debug.log(\"-------- Quiz invoking log --------\");\r\n self.debug.log({\r\n isHasQuiz: isHasQuiz,\r\n previousQuiz: self.previousQuiz,\r\n isAlreadyInvoked: isAlreadyInvoked\r\n });*/\r\n }\r\n\r\n // Invoke test if exists in current timespan\r\n if (isHasQuiz) {\r\n self.previousQuiz = isHasQuiz;\r\n let isInvokeOnce = self.player.options.quiz.invokeOnce;\r\n let hasInvokedState = $(`span.tick[data-timestamp=${currentTimestamp}]`).data('invoked') !== undefined;\r\n\r\n if ((!hasInvokedState || !isInvokeOnce) && !isAlreadyInvoked) {\r\n if (self.player.plyrPlayer.fullscreen.active) {\r\n self.player.plyrPlayer.fullscreen.exit()\r\n }\r\n\r\n this.quiz.invokeQuiz($(`span.tick[data-timestamp=${currentTimestamp}]`).data('quiz'), $(`span.tick[data-timestamp=${currentTimestamp}]`).data('csm'));\r\n $(`span.tick[data-timestamp=${currentTimestamp}]`).attr('data-invoked', 1);\r\n }\r\n\r\n self.debug.log(\"Quiz found: \" + $(`span.tick[data-timestamp=${currentTimestamp}]`).data('quiz'));\r\n }\r\n });\r\n }\r\n}\r\n","// =====================================================\r\n// WeLearn Pro Player - Chat module\r\n// =====================================================\r\n\r\nimport Debug from './util/debugHelper';\r\n\r\nexport default class Chat {\r\n constructor(player) {\r\n this.player = player;\r\n this.debug = new Debug(this.player.options.debug);\r\n }\r\n\r\n getChat() {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.chat.get.url,\r\n data: {\r\n cid: self.progressData.courseId,\r\n cb: self.progressData.courseBatchId\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Chat retrieval successful\");\r\n }\r\n\r\n $('.ddlchat-list').addClass('widthOpen');\r\n $('.overlay').addClass('active');\r\n\r\n $('.chat-detail').remove();\r\n $('li.course-head.chat-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Chat retrieval failed\");\r\n }\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_chatEvent();\r\n }\r\n\r\n createQuestion(message) {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.chat.insert.urlQuestion,\r\n data: {\r\n Message: message,\r\n cb: self.progressData.courseBatchId,\r\n cid: self.progressData.courseId,\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Add question successful\");\r\n }\r\n\r\n $.notify(\"สร้างหัวข้อสนทนาสำเร็จ\", \"success\");\r\n\r\n $('.chat-detail').remove();\r\n $('li.course-head.chat-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Add question failed\");\r\n }\r\n\r\n $.notify(\"สร้างหัวข้อสนทนาไม่สำเร็จ\", \"error\");\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_chatEvent();\r\n }\r\n\r\n createAnswer(courseChatQuestionId, message) {\r\n let self = this.player;\r\n\r\n $.ajax({\r\n url: self.options.chat.insert.urlAnswer,\r\n data: {\r\n Message: message,\r\n cb: self.progressData.courseBatchId,\r\n CourseChatQuestionId: courseChatQuestionId\r\n },\r\n async: false,\r\n type: 'post',\r\n success: function (result) {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Reply successful\");\r\n }\r\n\r\n $.notify(\"ตอบกลับสำเร็จ\", \"success\");\r\n\r\n $('.chat-detail').remove();\r\n $('li.course-head.chat-head').after(result);\r\n\r\n return true;\r\n },\r\n error: function () {\r\n if (self.options.debug === true) {\r\n console.log(\"DEBUG: Chat - Reply failed\");\r\n }\r\n\r\n $.notify(\"ตอบกลับผิดพลาด\", \"error\");\r\n\r\n return false;\r\n }\r\n });\r\n\r\n this.player.event._bind_chatEvent();\r\n }\r\n}","/**\r\n * ====================================================================\r\n * WeLearn Pro Player: Default video options configuration\r\n * Default configurations with comments\r\n * ====================================================================\r\n */\r\n\r\n/**\r\n * Default Plyr controls for preview mode\r\n * @type {string[]}\r\n */\r\nconst previewModeControls = [\r\n 'play-large', // The large play button in the center\r\n 'play', // Play/pause playback\r\n 'progress', // The progress bar and scrubber for playback and buffering\r\n 'current-time', // The current time of playback\r\n 'duration', // The full duration of the media\r\n 'mute', // Toggle mute\r\n 'volume', // Volume control\r\n 'fullscreen', // Toggle fullscreen\r\n];\r\n\r\n/**\r\n * Default Plyr controls for learning mode\r\n * @type {Array}\r\n */\r\nconst learningModeControls = [\r\n 'play-large', // The large play button in the center\r\n 'play', // Play/pause playback\r\n 'progress', // The progress bar and scrubber for playback and buffering\r\n 'current-time', // The current time of playback\r\n 'duration', // The full duration of the media\r\n 'mute', // Toggle mute\r\n 'volume', // Volume control\r\n 'captions', // Toggle captions\r\n 'settings', // Settings menu\r\n 'fullscreen', // Toggle fullscreen\r\n];\r\n\r\n/**\r\n * Default Plyr settings for learning mode\r\n *\r\n * @var {Array}\r\n */\r\nconst learningModeSettings = [\r\n 'captions',\r\n 'quality',\r\n 'loop'\r\n];\r\n\r\n/**\r\n * Defaulr Plyr settings for preview mode\r\n *\r\n * @var {Array}\r\n */\r\nconst previewModeSettings = [\r\n 'captions',\r\n 'quality',\r\n 'loop'\r\n];\r\n\r\nconst plyrControls = {\r\n previewModeControls,\r\n learningModeControls\r\n};\r\n\r\nconst plyrSettings = {\r\n previewModeSettings,\r\n learningModeSettings\r\n};\r\n\r\n/**\r\n * Default options for Plyr player that appreciable to WLP player\r\n * @type {{youtube: {controls: number, playsinline: number, showinfo: number}, debug: boolean, fullscreen: {iosNative: boolean, fallback: boolean, enabled: boolean}, blankVideo: string, ratio: string}}\r\n */\r\nconst plyrWlpOptions = {\r\n debug: false,\r\n fullscreen: {\r\n enabled: true,\r\n fallback: true,\r\n iosNative: false\r\n },\r\n youtube: {\r\n playsinline: 1,\r\n controls: 0,\r\n showinfo: 0\r\n },\r\n ratio: '16:9',\r\n blankVideo: 'https://cdn.plyr.io/static/blank.mp4',\r\n controls: [],\r\n settings: [],\r\n};\r\n\r\nexport { plyrControls, plyrSettings, plyrWlpOptions };\r\n","/**\r\n * ====================================================================\r\n * WeLearn Pro Player: Default WeLearnPro system configuration\r\n * This is a configuration that appreciable to WeLearnPro system\r\n * ====================================================================\r\n */\r\n\r\nconst wlpDefaultsOptions = {\r\n video: 'https://cdn.plyr.io/static/blank.mp4',\r\n embedVideo: false,\r\n seekable: true,\r\n debug: false,\r\n thumbnail: '',\r\n progress: {\r\n update: {\r\n url: '/Learning/UpdateProgressData/',\r\n interval: 15000,\r\n alert: true,\r\n }\r\n },\r\n note: {\r\n get: {\r\n url: '/Learning/SelectNote/',\r\n },\r\n save: {\r\n url: '/Learning/CreateNote/',\r\n },\r\n update: {\r\n url: '/Learning/UpdateNote/',\r\n },\r\n delete: {\r\n url: '/Learning/DeleteNote/',\r\n }\r\n },\r\n chat: {\r\n get: {\r\n url: '/Learning/GetChat/',\r\n },\r\n insert: {\r\n urlQuestion: '/Learning/PostQuestion/',\r\n urlAnswer: '/Learning/PostAnswer/'\r\n }\r\n },\r\n quiz: {\r\n invokeOnce: false\r\n }\r\n};\r\n\r\nexport { wlpDefaultsOptions }\r\n","/**\r\n * ====================================================================\r\n * WeLearn Pro Player\r\n * This script is a wrapper for Plyr player (https://plyr.io) for customize\r\n * events those will present in WeLearn Pro course video pages.\r\n *\r\n * Copyright© 2019 Wewasanad Co.,Ltd. All rights reserved.\r\n *\r\n * --------------------------------------------------------------------\r\n * Version 1.3.0.0 - 2020-09-30\r\n * * Add changelog\r\n * * Add default Plyr settings for learning and preview mode\r\n * * Plyr settings: Speed control is disabled by default\r\n * ====================================================================\r\n */\r\n\r\n\r\n// Use strict mode for better performance.\r\n'use strict';\r\n\r\n// Import helpers and components\r\nimport defaults from './config/defaults.js';\r\nimport { extend } from './util/objectHelper';\r\nimport Bootstrap4Helper from \"./util/bootstrapHelper.js\";\r\nimport Debug from './util/debugHelper.js'\r\nimport Note from './note.js';\r\nimport Caption from './caption.js';\r\nimport Slide from './slide.js';\r\nimport Loader from './loader.js';\r\nimport UI from './ui.js';\r\nimport Quiz from './quiz';\r\nimport Events from './events';\r\nimport Chat from './chat';\r\nimport { plyrControls, plyrSettings, plyrWlpOptions } from './config/plyr-defaults.js'\r\nimport { wlpDefaultsOptions } from './config/wlp-defaults.js'\r\n\r\n/**\r\n * WeLearn Pro Video Player class.\r\n */\r\nclass WeLearnProPlayer {\r\n //#debug = {};\r\n\r\n /**\r\n * WeLearn Pro Video Player class.\r\n * @param element - JQuery selector string of HTML5 video tag including # (Must define)\r\n * @param options - WeLearn Pro Player options (Optional)\r\n * @param progressData - User's video progress data (Optional)\r\n * @param videoComponent - WLP video components (Slide, test, etc)\r\n * @param plyrOptions - Plyr options\r\n */\r\n constructor(element, options = {}, progressData = {}, videoComponent = {}, plyrOptions = undefined) {\r\n this.element = element;\r\n this.options = extend ({}, defaults, wlpDefaultsOptions, options || {});\r\n this.plyrControls = plyrControls;\r\n this.plyrSettings = plyrSettings;\r\n this.progressData = progressData;\r\n this.videoComponent = videoComponent;\r\n this.syncSlide = this.options.slidesync;\r\n\r\n // Throw error if element is not defined.\r\n if (!element.length) {\r\n throw \"Undefined, unknown or null HTML video element. Please specify the name of element.\";\r\n }\r\n\r\n // Instantiate associated components.\r\n this.chat = new Chat(this);\r\n this.note = new Note(this);\r\n this.caption = new Caption(this);\r\n this.slide = new Slide(this);\r\n this.loader = new Loader(this);\r\n this.ui = new UI(this);\r\n this.quiz = new Quiz(this);\r\n this.event = {}; // Event will be instantiated after binding Plyr instance to element.\r\n this.debug = new Debug(this.options.debug);\r\n\r\n // Show debug message\r\n this.debug.log(\"WLP Player: Debug mode enabled.\");\r\n this.debug.log(\"===== WLP Player settings =====\");\r\n this.debug.log(this.options);\r\n this.debug.log(this.progressData);\r\n this.debug.log(this.videoComponent);\r\n this.debug.log(\"===============================\");\r\n\r\n this.loader.initVideo();\r\n this.bindPlyr(plyrOptions);\r\n }\r\n\r\n /**\r\n * Get pass status of user of this video\r\n * @returns {boolean} - true = passed, false = not passed.\r\n */\r\n get isPassByPercentage() {\r\n return this.progressPercentage > this.progressData.passConditions.watchedPercentage;\r\n }\r\n\r\n /**\r\n * Get watched progress in percentage\r\n * @returns {number} - Watched progress value in percentage\r\n */\r\n get progressPercentage() {\r\n let watchedSeconds = $('span.tick.watched').length;\r\n return (watchedSeconds * 100) / Math.floor(this.plyrPlayer.duration);\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Video options\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Get available captions of the video\r\n * @returns {object} - Caption list\r\n */\r\n get availableCaptions() {\r\n let captions = this.progressData[\"caption\"];\r\n let languages = {};\r\n\r\n for (let i = 0; i < captions.length; i++) {\r\n languages[i] = captions[i][\"label\"];\r\n }\r\n\r\n return languages;\r\n }\r\n\r\n /**\r\n * Bind Plyr player to default HTML video player. This let user access Plyr functionality.\r\n * @param options - Plyr options\r\n */\r\n bindPlyr(options) {\r\n\r\n if (!options) {\r\n options = plyrWlpOptions;\r\n }\r\n\r\n if (!options.controls || options.controls.length === 0) {\r\n if (this.options.previewMode === true) {\r\n options.controls = this.plyrControls.previewModeControls;\r\n } else {\r\n options.controls = this.plyrControls.learningModeControls;\r\n }\r\n }\r\n\r\n if (!options.settings || options.settings.length === 0) {\r\n if (this.options.previewMode === true) {\r\n options.settings = this.plyrSettings.previewModeSettings;\r\n } else {\r\n options.settings = this.plyrSettings.learningModeSettings;\r\n }\r\n }\r\n\r\n this.plyrPlayer = new Plyr(this.element, options);\r\n this.event = new Events(this);\r\n\r\n $(this.element).addClass('hytPlayerWrap');\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Note\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Delete an instance of WeLearn Pro Player\r\n * @deprecated Please use default Javascript feature to dispose.\r\n */\r\n dispose() {\r\n delete this;\r\n }\r\n\r\n /**\r\n * Set this video can be seek or not.\r\n * @param canSeek - true and false\r\n */\r\n seekablePlyrProgressBar(canSeek) {\r\n if (canSeek === true) {\r\n $('.plyr__progress').css({ 'pointer-events': 'auto' });\r\n return true;\r\n } else {\r\n $('.plyr__progress').css('pointer-events', 'none');\r\n return false;\r\n }\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Caption\r\n *\r\n * ======================================\r\n */\r\n\r\n captureThumbnail() {\r\n $('body').append($(''));\r\n let canvas = document.getElementById('tempCanvas');\r\n let video = this.element;\r\n canvas.getContext('2d').drawImage(video, 0, 0, video.videoWidth, video.videoHeight);\r\n canvas.remove();\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Slide\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Create note at the current time of video.\r\n * @param time\r\n * @param text\r\n */\r\n createNote(text, time = this.plyrPlayer.currentTime) {\r\n return this.note.createNote(text, time);\r\n }\r\n\r\n /**\r\n * Seek video to specific time.\r\n * @param time - Time of video.\r\n * @param useSeekableOption - Apply 'seekable' rule from video option.\r\n */\r\n seekTo(time, useSeekableOption) {\r\n return this.note.seekTo(time, useSeekableOption);\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Quiz\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Add caption to video (Must be load before the player finished initialize)\r\n * @param label - Language name\r\n * @param srclang - Language abbreviation\r\n * @param src - Caption file path\r\n * @param setDefault - Set to true if this language is default language or vice versa\r\n */\r\n addCaption(label, srclang, src, setDefault = false) {\r\n return this.caption.addCaption(label, srclang, src, setDefault);\r\n }\r\n\r\n /**\r\n * Change slide page to specify page.\r\n * @param slidePage - Slide page to change to.\r\n */\r\n changeSlidePage(slidePage) {\r\n return this.slide.changeSlidePage(slidePage);\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Getters\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Toggle sync slide\r\n */\r\n toggleSyncSlide() {\r\n if (this.syncSlide === undefined) {\r\n this.syncSlide = false;\r\n }\r\n\r\n return this.syncSlide = this.syncSlide ? this.slide.unsyncSlide() : this.slide.syncSlide();\r\n }\r\n\r\n /**\r\n * Invoke quiz by quiz ID.\r\n * @param quizId - Quiz ID\r\n */\r\n invokeQuiz(quizId) {\r\n return this.quiz.invokeQuiz(quizId);\r\n }\r\n\r\n /**\r\n * Unload quiz from screen.\r\n */\r\n unloadQuiz() {\r\n return this.quiz.unloadQuiz();\r\n }\r\n\r\n /** =====================================\r\n *\r\n * Wrappers\r\n *\r\n * ======================================\r\n */\r\n\r\n /**\r\n * Create alert that appear under WeLearn Pro Player. (This is a wrapper of BootstrapHelper)\r\n * @param message - Message to show.\r\n * @param timeout - Time to close alert.\r\n */\r\n invokeAlert(message, timeout) {\r\n Bootstrap4Helper.invokeAlert(message, timeout, '.wlpVideo__progress-bar');\r\n }\r\n}\r\n"]}