From 9dc4f7a10e16ff5de9694e94b50e55f511d99142 Mon Sep 17 00:00:00 2001 From: justinhunt Date: Thu, 21 May 2020 21:58:49 +0900 Subject: [PATCH] build js and version bump --- CHANGES.txt | 3 ++- amd/build/mediaparser.min.js.map | 1 + amd/build/s3multipartupload.min.js.map | 1 + version.php | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 amd/build/mediaparser.min.js.map create mode 100644 amd/build/s3multipartupload.min.js.map diff --git a/CHANGES.txt b/CHANGES.txt index fce773fa..b4582ca7 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,10 +1,11 @@ Change List ========= -Version 3.1.30 (Build 2020XXXXXX) +Version 3.1.30 (Build 2020052000) -Added support for audio/x-m4a mimetype -Added multipart uploader (experimental) -Fixed Adam player -Replaced Elastic Transcoder call (postupload) with DynamoDB job log (pre upload) +-added player widget templates Version 3.1.29 (Build 2020041700) -fixed broken whiteboard saving diff --git a/amd/build/mediaparser.min.js.map b/amd/build/mediaparser.min.js.map new file mode 100644 index 00000000..1f2f7473 --- /dev/null +++ b/amd/build/mediaparser.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/mediaparser.js"],"names":["define","$","log","debug","parse","containerid","mediatype","ret","mediaurl","lang","subtitlesurl","sources","originalplayer","first","length","attr","addClass","originallink","split","urlParams","URLSearchParams","get"],"mappings":"AACAA,OAAM,6BAAC,CAAC,QAAD,CAAW,UAAX,CAAD,CAAyB,SAAUC,CAAV,CAAaC,CAAb,CAAkB,CAE7C,aAEAA,CAAG,CAACC,KAAJ,CAAU,4BAAV,EAEA,MAAO,CACJC,KAAK,CAAG,eAASC,CAAT,CAAsBC,CAAtB,CAAiC,IACjCC,CAAAA,CAAG,CAAG,CACNC,QADM,IAENC,IAFM,IAGNC,YAHM,IAINC,OAJM,IAD2B,CAQjCC,CAAc,CAAGX,CAAC,CAAC,IAAMI,CAAN,CAAoB,GAApB,CAA0BC,CAA3B,CAAD,CAAuCO,KAAvC,EAR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AACG,YAAJ,WAAmE,CAAjC,CAAAH,CAAG,CAACC,QAAJ,CAAaU,KAAb,CAAmB,GAAnB,EAAwBJ,MAA9D,CAA0E,CACtE,GAAIK,CAAAA,CAAS,CAAG,GAAIC,CAAAA,eAAJ,CAAoBb,CAAG,CAACC,QAAJ,CAAaU,KAAb,CAAmB,GAAnB,EAAwB,CAAxB,CAApB,CAAhB,CACAX,CAAG,CAACG,YAAJ,CAAmBS,CAAS,CAACE,GAAV,CAAc,gBAAd,CAAnB,CACAd,CAAG,CAACE,IAAJ,CAAWU,CAAS,CAACE,GAAV,CAAc,eAAd,CAAX,CACAd,CAAG,CAACC,QAAJ,CAAeA,QAAQ,CAACU,KAAT,CAAe,GAAf,EAAoB,CAApB,CAClB,CAGDD,CAAY,CAACD,QAAb,CAAsB,eAAtB,EACAC,CAAY,CAACD,QAAb,CAAsB,UAAtB,CACH,CACD,MAAOT,CAAAA,CACV,CA/CG,CAiDV,CAvDK,CAAN","sourcesContent":["/* jshint ignore:start */\ndefine(['jquery', 'core/log'], function ($, log) {\n\n \"use strict\"; // jshint ;_;\n\n log.debug('Media Parser: initialising');\n\n return {\n parse: function(containerid, mediatype) {\n var ret = {};\n ret.mediaurl = false;\n ret.lang = false;\n ret.subtitlesurl = false;\n ret.sources = false;\n\n //do we have an audio player?\n var originalplayer = $('#' + containerid + ' ' + mediatype).first();\n if (originalplayer.length === 1) {\n\n ret.lang = $('#' + containerid + ' ' + mediatype + ' track[kind=\"captions\"]').first().attr('srclang');\n ret.subtitlesurl = $('#' + containerid + ' ' + mediatype + ' track[kind=\"captions\"]').first().attr('src');\n\n if (originalplayer.attr('src') !== undefined) {\n ret.mediaurl = originalplayer.attr('src');\n } else {\n ret.mediaurl = $('#' + containerid + ' ' + mediatype + ' source').first().attr('src');\n }\n ret.sources = $('#' + containerid + ' ' + mediatype + ' source');\n\n\n //make sure moodle and poodll leave it alone from here on\n originalplayer.addClass('nomediaplugin');\n originalplayer.addClass('nopoodll');\n } else {\n\n //hopefully we have data attributes in the a link\n var originallink = $('#' + containerid + ' a').first();\n ret.mediaurl = originallink.attr('href');\n ret.lang = originallink.attr('data-lang');\n ret.subtitlesurl = originallink.attr('data-subtitles');\n\n //but we might be in the old form where they were params on the url\n if (ret.subtitlesurl === undefined && ret.mediaurl.split('?').length > 0) {\n var urlParams = new URLSearchParams(ret.mediaurl.split('?')[1]);\n ret.subtitlesurl = urlParams.get('data-subtitles');\n ret.lang = urlParams.get('data-language');\n ret.mediaurl = mediaurl.split('?')[0]\n }\n\n //make sure moodle and poodll leave it alone from here on\n originallink.addClass('nomediaplugin');\n originallink.addClass('nopoodll');\n }\n return ret; \n }//end of parse function\n };//end of returned object\n});//total end\n"],"file":"mediaparser.min.js"} \ No newline at end of file diff --git a/amd/build/s3multipartupload.min.js.map b/amd/build/s3multipartupload.min.js.map new file mode 100644 index 00000000..f90c9c7a --- /dev/null +++ b/amd/build/s3multipartupload.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../src/s3multipartupload.js"],"names":["define","$","log","debug","PART_SIZE","SERVER_LOC","completed","file","fileInfo","sendBackData","uploadXHR","partURLs","byterate","lastUploadedSize","lastUploadedTime","loaded","total","init","name","type","size","lastModifiedDate","createMultipartUpload","xhr","XMLHttpRequest","that","onreadystatechange","readyState","status","payload","responseText","payloadobject","JSON","parse","returnCode","messageObject","id","config","code","message","returnMessage","hermes","postMessage","allowedURL","posturl","postURL","filename","s3filename","s3root","cloudfilename","shortfilename","cloudroot","shortroot","sendAll","parts","prepareParts","xhrparams","wstoken","moodlewsrestformat","mediatype","serverurl","M","cfg","wwwroot","open","setRequestHeader","send","doMultipartUpload","start","blobs","end","blob","partNum","Math","min","filePart","slice","push","i","length","partNumber","contentLength","sendToS3","theurl","index","self","request","updateProgress","onS3UploadError","upload","onprogress","e","lengthComputable","time_diff","Date","getTime","cancel","abort","post","command","done","completeMultipartUpload","data","onUploadCompleted","fail","jqXHR","textStatus","errorThrown","onServerError","complete","onProgressChanged","onPrepare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CACA+B,CAAQ,CAAC,CACZ,CACJ,CACD,GAAIA,CAAJ,CACI,KAAKR,uBAAL,GACJrF,CAAK,CAAC,KAAKR,QAAL,CAAcY,IAApB,CACA,KAAK0F,iBAAL,CAAuB/F,CAAvB,CAA+BC,CAA/B,CAAsCJ,CAAtC,CACH,CA3XU,CAuYXgG,aAAa,CAAE,wBAAkD,CAAE,CAvYxD,CA8YXpB,eAAe,CAAE,0BAAc,CAAE,CA9YtB,CAuZXsB,iBAAiB,CAAE,4BAA2C,CAAE,CAvZrD,CA6ZXP,iBAAiB,CAAE,4BAAqB,CAAE,CA7Z/B,CAkaXQ,kBAAkB,CAAE,6BAAW,CAAE,CAlatB,CAqaV,CA3aK,CAAN","sourcesContent":["/* jshint ignore:start */\ndefine(['jquery', 'core/log'], function ($, log) {\n\n \"use strict\"; // jshint ;_;\n\n log.debug('Filter PoodLL: s3multipartupload initialising');\n\n return {\n\n PART_SIZE: 10 * 1024 * 1024, // Minimum part size defined by aws s3 is 5 MB(5 * 1024 * 1024), maximum 5 GB (5 * 1024 * 1024 * 1024)\n SERVER_LOC: '?', // Location of the server\n completed: false,\n file: null,\n fileInfo: null,\n sendBackData: null,\n uploadXHR: [],\n partURLs: [],\n // Progress monitoring\n byterate: [],\n lastUploadedSize: [],\n lastUploadedTime: [],\n loaded: [],\n total: [],\n\n\n init: function (file) {\n this.completed = false;\n this.file = file;\n this.fileInfo = {\n name: this.file.name,\n type: this.file.type,\n size: this.file.size,\n lastModifiedDate: this.file.lastModifiedDate\n };\n this.sendBackData = null;\n this.uploadXHR = [];\n // Progress monitoring\n this.byterate = [];\n this.lastUploadedSize = [];\n this.lastUploadedTime = [];\n this.loaded = [];\n this.total = [];\n\n },\n\n /**\n * Creates the multipart upload\n */\n createMultipartUpload: function () {\n\n //The REST API we are calling\n var functionname = 'local_cpapi_fetch_multipartupload_details';\n\n //fetch the Posturl. We need this.\n //set up our ajax request\n var xhr = new XMLHttpRequest();\n var that = this;\n\n //set up our handler for the response\n xhr.onreadystatechange = function (e) {\n if (this.readyState === 4) {\n if (xhr.status == 200) {\n\n //get a yes or forgetit or tryagain\n var payload = xhr.responseText;\n var payloadobject = JSON.parse(payload);\n if (payloadobject) {\n\n //returnCode > 0 indicates an error\n if (payloadobject.returnCode > 0) {\n //We alert the iframe host that something did not go right\n var messageObject = {};\n messageObject.id = that.config.id;\n messageObject.type = \"error\";\n messageObject.code = payloadobject.returnCode;\n messageObject.message = payloadobject.returnMessage;\n that.config.hermes.postMessage(messageObject);\n return;\n //if all good, then lets do the upload\n } else {\n that.partURLs = payloadobject.partURLs;\n that.config.allowedURL = payloadobject.allowedURL;\n that.config.posturl = payloadobject.postURL;\n that.config.filename = payloadobject.filename;\n that.config.s3filename = payloadobject.s3filename;\n that.config.s3root = payloadobject.s3root;\n that.config.cloudfilename = payloadobject.shortfilename;\n that.config.cloudroot = payloadobject.shortroot;\n\n //do the upload\n that.sendAll();\n }\n } else {\n log.debug('error:' + payloadobject.message);\n }\n } else {\n log.debug('Not 200 response:' + xhr.status);\n }\n }\n };\n\n //prepare our upload parts\n var parts = this.prepareParts();\n\n\n //log.debug(params);\n var xhrparams = \"wstoken=\" + this.config.wstoken\n + \"&wsfunction=\" + functionname\n + \"&moodlewsrestformat=\" + this.config.moodlewsrestformat\n + \"&mediatype=\" + this.config.mediatype\n + '&parts=' + parts;\n\n var serverurl = M.cfg.wwwroot + \"/webservice/rest/server.php\";\n xhr.open(\"POST\", serverurl, true);\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.send(xhrparams);\n },\n\n /**\n * Creates the multipart upload\n */\n doMultipartUpload: function () {\n\n //The REST API we are calling\n var functionname = 'local_cpapi_fetch_multipartupload_urls';\n\n //fetch the Posturl. We need this.\n //set up our ajax request\n var xhr = new XMLHttpRequest();\n var that = this;\n\n //set up our handler for the response\n xhr.onreadystatechange = function (e) {\n if (this.readyState === 4) {\n if (xhr.status == 200) {\n\n //get a yes or forgetit or tryagain\n var payload = xhr.responseText;\n var payloadobject = JSON.parse(payload);\n if (payloadobject) {\n\n //returnCode > 0 indicates an error\n if (payloadobject.returnCode > 0) {\n //We alert the iframe host that something did not go right\n var messageObject = {};\n messageObject.id = that.config.id;\n messageObject.type = \"error\";\n messageObject.code = payloadobject.returnCode;\n messageObject.message = payloadobject.returnMessage;\n that.config.hermes.postMessage(messageObject);\n return;\n //if all good, then lets do the upload\n } else {\n that.partURLs = payloadobject.partURLs;\n that.config.allowedURL = payloadobject.allowedURL;\n that.config.posturl = payloadobject.postURL;\n that.config.filename = payloadobject.filename;\n that.config.s3filename = payloadobject.s3filename;\n that.config.s3root = payloadobject.s3root;\n that.config.cloudfilename = payloadobject.shortfilename;\n that.config.cloudroot = payloadobject.shortroot;\n\n //do the upload\n that.sendAll();\n }\n } else {\n log.debug('error:' + payloadobject.message);\n }\n } else {\n log.debug('Not 200 response:' + xhr.status);\n }\n }\n };\n\n //prepare our upload parts\n var parts = this.prepareParts();\n\n\n //log.debug(params);\n var xhrparams = \"wstoken=\" + this.config.wstoken\n + \"&wsfunction=\" + functionname\n + \"&moodlewsrestformat=\" + this.config.moodlewsrestformat\n + \"&mediatype=\" + this.config.mediatype\n + '&parts=' + parts;\n\n var serverurl = M.cfg.wwwroot + \"/webservice/rest/server.php\";\n xhr.open(\"POST\", serverurl, true);\n xhr.setRequestHeader(\"Cache-Control\", \"no-cache\");\n xhr.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n xhr.send(xhrparams);\n },\n\n\n/**\n * Call this function to start uploading to server\n */\nstart: function() {\n this.createMultipartUpload();\n},\n\n/** private */\nprepareParts: function() {\n var blobs = this.blobs = [];\n this.partURLs = [];\n var start = 0;\n var parts =[];\n var end, blob;\n var partNum = 0;\n\n //create blobs and determine each blob file size\n while(start < this.file.size) {\n end = Math.min(start + this.PART_SIZE, this.file.size);\n filePart = this.file.slice(start, end);\n // this is to prevent push blob with 0Kb\n if (filePart.size > 0)\n blobs.push(filePart);\n start = this.PART_SIZE * ++partNum;\n }\n //return blob details so we can use them when uploading\n for (var i = 0; i < blobs.length; i++) {\n blob = blobs[i];\n parts[i]={};\n parts[i].partNumber= i+1;\n parts[i].contentLength = blob.size;\n }\n return parts;\n},\n\n\n /*\nuploadParts: function() {\n var blobs = this.blobs = [], promises = [];\n var start = 0;\n var parts =0;\n var end, blob;\n var partNum = 0;\n\n while(start < this.file.size) {\n end = Math.min(start + this.PART_SIZE, this.file.size);\n filePart = this.file.slice(start, end);\n // this is to prevent push blob with 0Kb\n if (filePart.size > 0)\n blobs.push(filePart);\n start = this.PART_SIZE * ++partNum;\n }\n //fetch and store the presigned upload URLs\n for (var i = 0; i < blobs.length; i++) {\n blob = blobs[i];\n promises.push(this.uploadXHR[i]=$.post(this.SERVER_LOC, {\n command: 'part',\n sendBackData: this.sendBackData,\n partNumber: i+1,\n contentLength: blob.size\n }));\n }\n $.when.apply(null, promises)\n .then(this.sendAll.bind(this), this.onServerError)\n .done(this.onPrepareCompleted);\n},\n*/\n\n/**\n * Sends all the created upload parts in a loop\n */\nsendAll: function() {\n var blobs = this.blobs;\n var length = blobs.length;\n for (var i = 0; i < length; i++) {\n this.sendToS3(partURLs[i], blobs[i], i);\n }\n},\n\n/**\n * Used to send each uploadPart\n * @param theurl the upload url\n * @param blob blob data bytes\n * @param int index part index (base zero)\n */\nsendToS3: function(theurl, blob, index) {\n var self = this;\n var size = blob.size;\n var request = self.uploadXHR[index] = new XMLHttpRequest();\n\n //handle a result from request object\n request.onreadystatechange = function() {\n if (request.readyState === 4) { // 4 is DONE\n // self.uploadXHR[index] = null;\n if (request.status !== 200) {\n self.updateProgress();\n self.onS3UploadError(request);\n return;\n }\n self.updateProgress();\n }\n };\n\n //handle an on progress event from the upload of the request\n request.upload.onprogress = function(e) {\n if (e.lengthComputable) {\n self.total[index] = size;\n self.loaded[index] = e.loaded;\n if (self.lastUploadedTime[index])\n {\n var time_diff=(new Date().getTime() - self.lastUploadedTime[index])/1000;\n if (time_diff > 0.005) // 5 miliseconds has passed\n {\n var byterate=(self.loaded[index] - self.lastUploadedSize[index])/time_diff;\n self.byterate[index] = byterate;\n self.lastUploadedTime[index]=new Date().getTime();\n self.lastUploadedSize[index]=self.loaded[index];\n }\n }\n else\n {\n self.byterate[index] = 0;\n self.lastUploadedTime[index]=new Date().getTime();\n self.lastUploadedSize[index]=self.loaded[index];\n }\n // Only send update to user once, regardless of how many\n // parallel XHRs we have (unless the first one is over).\n if (index==0 || self.total[0]==self.loaded[0])\n self.updateProgress();\n }\n };\n //send the request !!\n request.open('PUT', theurl, true);\n request.send(blob);\n\n}, //end of sendToS3\n\n/**\n * Abort multipart upload\n */\ncancel: function() {\n var self = this;\n for (var i=0; iversion = 2020041700; +$plugin->version = 2020052000; $plugin->requires = 2016052300;//moodle 3.1.0 $plugin->component = 'filter_poodll'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = '3.1.29(Build 2020041700)'; +$plugin->release = '3.1.30(Build 2020052000)';