{"version":3,"file":"poodllrecorder.min.js","sources":["../src/poodllrecorder.js"],"sourcesContent":["/* jshint ignore:start */\ndefine(['jquery',\n        'core/log',\n        'filter_poodll/poodll_flashrecorder',\n        'filter_poodll/poodll_mediarecorder',\n        'filter_poodll/poodll_uploadrecorder',\n        'filter_poodll/poodll_mobilerecorder',\n        'filter_poodll/poodll_flashsnapshotrecorder',\n        'filter_poodll/poodll_snapshotrecorder',\n        'filter_poodll/poodll_red5recorder'],\n    function ($, log, flashrec, mediarec, uploadrec, mobilerec, flashsnapshot, snapshot, red5) {\n\n        \"use strict\"; // jshint ;_;\n\n        log.debug('PoodLL Recorder: initialising');\n\n        return {\n\n            //init the poodll recorder\n            //basically we check the users preferred recorders and if the rec supports the browser\n            init: function (config) {\n\n                //pick up opts from html\n                var theid = '#amdopts_' + config.widgetid;\n                var configcontrol = $(theid).get(0);\n                if (configcontrol) {\n                    this.config = JSON.parse(configcontrol.value);\n                    $(theid).remove();\n                } else {\n                    //if there is no config we might as well give up\n                    log.debug('PoodLL Recorder: No config found on page. Giving up.');\n                    return;\n                }\n\n                //we are going to need the site url and the sess key\n                this.config.wwwroot = M.cfg.wwwroot;\n                this.config.sesskey = M.cfg.sesskey;\n\n                var element = this.config.selector;\n                if (!element) {\n                    log.debug(\"unable to fetch element with selector:\" + this.config.selector);\n                    return;\n                }\n                var use_rec = false;\n                for (var i = 0; i < this.config['rec_order'].length; i++) {\n                    switch (this.config['rec_order'][i]) {\n                        case 'red5':\n                            use_rec = red5;\n                            break;\n                        case 'flashaudio':\n                            use_rec = flashrec;\n                            break;\n                        case 'media':\n                            use_rec = mediarec;\n                            break;\n                        case 'upload':\n                            use_rec = uploadrec;\n                            break;\n                        case 'mobile':\n                            use_rec = mobilerec;\n                            break;\n                        case 'flashsnapshot':\n                            use_rec = flashsnapshot;\n                            break;\n                        case 'snapshot':\n                            use_rec = snapshot;\n                            break;\n                    }//end of switch\n\n                    //if current browser supported by rec, then embed and return\n                    if (use_rec.supports_current_browser(this.config)) {\n                        use_rec.embed(element, this.config);\n                        return;\n                    } // end of current browser support check\n                }//end of each\n\n                //if we got here no recorder was preferred AND supported the browser\n                log.debug('none of available recorders works on this browser');\n            }\n        };//end of returned object\n    });//total end\n"],"names":["define","$","log","flashrec","mediarec","uploadrec","mobilerec","flashsnapshot","snapshot","red5","debug","init","config","theid","widgetid","configcontrol","get","JSON","parse","value","remove","wwwroot","M","cfg","sesskey","element","this","selector","use_rec","i","length","supports_current_browser","embed"],"mappings":"AACAA,sCAAO,CAAC,SACA,WACA,qCACA,qCACA,sCACA,sCACA,6CACA,wCACA,sCACJ,SAAUC,EAAGC,IAAKC,SAAUC,SAAUC,UAAWC,UAAWC,cAAeC,SAAUC,aAIjFP,IAAIQ,MAAM,iCAEH,CAIHC,KAAM,SAAUC,YAGRC,MAAQ,YAAcD,OAAOE,SAC7BC,cAAgBd,EAAEY,OAAOG,IAAI,MAC7BD,oBACKH,OAASK,KAAKC,MAAMH,cAAcI,OACvClB,EAAEY,OAAOO,cAQRR,OAAOS,QAAUC,EAAEC,IAAIF,aACvBT,OAAOY,QAAUF,EAAEC,IAAIC,YAExBC,QAAUC,KAAKd,OAAOe,YACrBF,iBAIDG,SAAU,EACLC,EAAI,EAAGA,EAAIH,KAAKd,OAAL,UAAyBkB,OAAQD,IAAK,QAC9CH,KAAKd,OAAL,UAAyBiB,QACxB,OACDD,QAAUnB,eAET,aACDmB,QAAUzB,mBAET,QACDyB,QAAUxB,mBAET,SACDwB,QAAUvB,oBAET,SACDuB,QAAUtB,oBAET,gBACDsB,QAAUrB,wBAET,WACDqB,QAAUpB,YAKdoB,QAAQG,yBAAyBL,KAAKd,oBACtCgB,QAAQI,MAAMP,QAASC,KAAKd,QAMpCV,IAAIQ,MAAM,0DArCNR,IAAIQ,MAAM,yCAA2CgB,KAAKd,OAAOe,eAVjEzB,IAAIQ,MAAM"}