-
Notifications
You must be signed in to change notification settings - Fork 5
/
CasparCG Video Player v0.4.json
1 lines (1 loc) · 26.3 KB
/
CasparCG Video Player v0.4.json
1
[{"id":"65d60dbf.db7254","type":"ui_text_input","z":"1b66da0f.f06f66","name":"Local Path Text Input","label":"Local Path (use forward slash/):","group":"c189975a.add948","order":2,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"","x":140,"y":140,"wires":[["176630d1.dfb60f"]]},{"id":"e3604dcf.6438b","type":"ui_dropdown","z":"1b66da0f.f06f66","name":"File List","label":"Files","place":"Select File","group":"191211e4.b7790e","order":1,"width":0,"height":0,"passthru":false,"options":[{"label":"","value":0,"type":"num"}],"payload":"","topic":"","x":1240,"y":140,"wires":[["45db6776.d1a718","2849c851.504778","2612733a.2ffd9c"]]},{"id":"66a65224.bb3e5c","type":"function","z":"1b66da0f.f06f66","name":"create pulldown / set global.list_length and global.master_playlist","func":"var full_path_array = msg.payload;\n\nvar file_name_array = [];\nvar options_pulldown_array = [];\nvar full_path_object = {};\n\nglobal.set(\"list_length\", msg.payload.length);\n\nfor(var i = 0; i<msg.payload.length; i++) {\n \n var list_value = {};\n file_name_array[i] = full_path_array[i].replace(/^.*[\\\\\\/]/, '');\n list_value[file_name_array[i]] = full_path_array[i];\n options_pulldown_array[i] = list_value;\n \n}\n\nfull_path_object.payload = file_name_array;\nglobal.set(\"master_list\", full_path_array);\nmsg.options = options_pulldown_array;\n\nreturn [msg, full_path_object];","outputs":2,"noerr":0,"x":890,"y":160,"wires":[["e3604dcf.6438b","e1a4fcc5.60acc"],["601b6429.4c218c"]]},{"id":"176630d1.dfb60f","type":"function","z":"1b66da0f.f06f66","name":"set folder path","func":"global.set(\"local_path\", msg.payload);\nvar full_path = global.get(\"caspar_path\") + msg.payload;\nmsg.payload = {\"start\": full_path};\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":140,"wires":[["11a05d46.9518c3","15487235.16994e"]]},{"id":"11a05d46.9518c3","type":"debug","z":"1b66da0f.f06f66","name":"File Lister parameters","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":600,"y":240,"wires":[]},{"id":"7ba424f9.cd6f8c","type":"ui_text_input","z":"1b66da0f.f06f66","name":"Pattern Text Input","label":"Pattern Filter (*.mov): ","group":"c189975a.add948","order":3,"width":0,"height":0,"passthru":true,"mode":"text","delay":"0","topic":"","x":150,"y":180,"wires":[["cd8d5b2f.aaf1d8"]]},{"id":"cd8d5b2f.aaf1d8","type":"function","z":"1b66da0f.f06f66","name":"set pattern filter","func":"msg.payload = {\"pattern\":msg.payload};\n\nreturn msg;","outputs":1,"noerr":0,"x":360,"y":180,"wires":[["11a05d46.9518c3","15487235.16994e"]]},{"id":"601b6429.4c218c","type":"ui_template","z":"1b66da0f.f06f66","group":"c189975a.add948","name":"File List Template","order":4,"width":"6","height":"8","format":"<h4>File List:</h4>\n<p ng-repeat=\"row in msg.payload\">{{row}}</p>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1270,"y":200,"wires":[[]]},{"id":"2849c851.504778","type":"ffprobe","z":"1b66da0f.f06f66","name":"","prefix":"","x":1410,"y":140,"wires":[["f01b1641.081ee8"]]},{"id":"d5815823.6d7408","type":"debug","z":"1b66da0f.f06f66","name":"JSON object describing media file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2020,"y":140,"wires":[]},{"id":"e6719b79.7593e8","type":"ui_template","z":"1b66da0f.f06f66","group":"191211e4.b7790e","name":"File Info","order":2,"width":"6","height":"5","format":"<p>codec type: {{msg.payload.codec_type}}\n<p>codec: {{msg.payload.codec_long_name}}\n<p>duration: {{msg.payload.formatted_duration}}\n<p>dimensions: {{msg.payload.width}} x {{msg.payload.height}}\n<p>aspect: {{msg.payload.display_aspect_ratio}}\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1800,"y":140,"wires":[["d5815823.6d7408"]]},{"id":"f01b1641.081ee8","type":"function","z":"1b66da0f.f06f66","name":"Format Seconds to h m s","func":"var secs = msg.payload.duration;\nglobal.set(\"file_length\", secs);\nvar hours = Math.floor(secs / (60 * 60));\n\nvar divisor_for_minutes = secs % (60 * 60);\nvar minutes = Math.floor(divisor_for_minutes / 60);\n\nvar divisor_for_seconds = divisor_for_minutes % 60;\nvar seconds = (Math.round(divisor_for_seconds * 10) / 10).toFixed(1);\n//var seconds = Math.ceil(divisor_for_seconds);\n\nvar time = hours + 'h:' + minutes + 'm:' + seconds + 's';\n\nmsg.payload.formatted_duration = time;\n\nreturn [msg];","outputs":1,"noerr":0,"x":1610,"y":140,"wires":[["e6719b79.7593e8"]]},{"id":"45db6776.d1a718","type":"debug","z":"1b66da0f.f06f66","name":"list value","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1440,"y":100,"wires":[]},{"id":"e1a4fcc5.60acc","type":"debug","z":"1b66da0f.f06f66","name":"list maker","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"options","x":1240,"y":80,"wires":[]},{"id":"13ae5d04.77acf3","type":"ui_button","z":"1b66da0f.f06f66","name":"PLAY 1-0 SELECTED FILE","group":"191211e4.b7790e","order":3,"width":0,"height":0,"passthru":false,"label":"PLAY 1-0 SELECTED FILE","color":"","bgcolor":"","icon":"","payload":"","payloadType":"date","topic":"","x":1260,"y":300,"wires":[["f507218b.c77b7"]]},{"id":"cfcb4134.7ea64","type":"amcp","z":"1b66da0f.f06f66","name":"CasparCG localhost:5250","port":"5250","host":"localhost","x":1850,"y":400,"wires":[["22a534c0.40ec0c"]]},{"id":"22a534c0.40ec0c","type":"debug","z":"1b66da0f.f06f66","name":"CasparCG response","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2080,"y":400,"wires":[]},{"id":"acf54dda.c3dce","type":"ui_button","z":"1b66da0f.f06f66","name":"STOP 1-0","group":"191211e4.b7790e","order":4,"width":0,"height":0,"passthru":false,"label":"STOP 1-0","color":"","bgcolor":"","icon":"","payload":"STOP 1-0","payloadType":"str","topic":"","x":1200,"y":340,"wires":[["cfcb4134.7ea64"]]},{"id":"2612733a.2ffd9c","type":"function","z":"1b66da0f.f06f66","name":"set global.selected_file and global.play_file","func":"global.set(\"selected_file\", msg.payload);\nglobal.set(\"play_file\", global.get(\"local_path\") + global.get(\"selected_file\").replace(/^.*[\\\\\\/]/, ''));\nglobal.set(\"full_path_file\", global.get(\"caspar_path\") + global.get(\"play_file\"));","outputs":1,"noerr":0,"x":1670,"y":200,"wires":[[]]},{"id":"f507218b.c77b7","type":"function","z":"1b66da0f.f06f66","name":"Format Play Command","func":"var playfile = global.get(\"local_path\") + global.get(\"selected_file\").replace(/^.*[\\\\\\/]/, '');\nmsg.payload = \"PLAY 1-0 \" + playfile;\nreturn msg;","outputs":1,"noerr":0,"x":1530,"y":300,"wires":[["cfcb4134.7ea64","3146197c.7560c6"]]},{"id":"340fb0c0.25a1b","type":"ui_text","z":"1b66da0f.f06f66","group":"c189975a.add948","order":1,"width":0,"height":0,"name":"CasparCG Media Folder Path Text:","label":"CasparCG Media Folder Path:","format":"{{msg.payload}}","layout":"col-center","x":780,"y":60,"wires":[]},{"id":"987ed1db.9c135","type":"function","z":"1b66da0f.f06f66","name":"set CasparCG Media File Path","func":"global.set(\"caspar_path\", msg.payload);\nglobal.set(\"local_path\", '');\nglobal.set(\"pattern\", '');\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":60,"wires":[["340fb0c0.25a1b"]]},{"id":"7b6287fa.be06c8","type":"inject","z":"1b66da0f.f06f66","name":"Set Capsar Media Folder Path","topic":"","payload":"C:\\CasparCG\\server\\media\\","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"0","x":130,"y":60,"wires":[["987ed1db.9c135","c7f1cdc7.d2f53"]]},{"id":"3146197c.7560c6","type":"debug","z":"1b66da0f.f06f66","name":"playfile command","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1790,"y":280,"wires":[]},{"id":"cc525a5c.dda1c8","type":"ui_button","z":"1b66da0f.f06f66","name":"Play Media in Order Button","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"passthru":false,"label":"Play Media in Order","color":"","bgcolor":"","icon":"","payload":"play_in_order","payloadType":"str","topic":"","x":220,"y":560,"wires":[["661f6600.9c3238"]]},{"id":"712c99af.dc2298","type":"ui_button","z":"1b66da0f.f06f66","name":"Random Play without Duplicates Button","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"passthru":false,"label":"Random Play without Duplicates","color":"","bgcolor":"","icon":"","payload":"play_randomly","payloadType":"str","topic":"","x":180,"y":640,"wires":[["3f370b42.20e514"]]},{"id":"3f370b42.20e514","type":"function","z":"1b66da0f.f06f66","name":"random without duplicates","func":"global.set(\"playback_type\", \"random\");\nvar list_length = global.get(\"list_length\");\nvar length_array = [];\nfor(var i=0; i<list_length; i++){\n length_array[i] = i;\n}\nfunction shuffle(array) {\n var i = array.length,\n j = 0,\n temp;\n\n while (i--) {\n\n j = Math.floor(Math.random() * (i+1));\n\n // swap randomly chosen element with current element\n temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n\n }\n\n return array;\n}\n\nvar random_order = shuffle(length_array);\nglobal.set(\"playback_list\", random_order);\nglobal.set(\"playback_counter\", 0);\nmsg.payload = random_order;\nreturn msg;","outputs":1,"noerr":0,"x":490,"y":640,"wires":[["c81da2df.686d5","635b6e2c.8fe8a"]]},{"id":"1c4b6660.52eefa","type":"inject","z":"1b66da0f.f06f66","name":"Random Play without Duplicates","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":680,"wires":[["3f370b42.20e514"]]},{"id":"847e7f2f.cdcb7","type":"inject","z":"1b66da0f.f06f66","name":"Play Media in Order","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":250,"y":600,"wires":[["661f6600.9c3238"]]},{"id":"661f6600.9c3238","type":"function","z":"1b66da0f.f06f66","name":"play in order","func":"global.set(\"playback_type\", \"ordered\");\nvar list_length = global.get(\"list_length\");\nvar length_array = [];\nfor(var i=0; i<list_length; i++){\n length_array[i] = i;\n}\nglobal.set(\"playback_list\", length_array);\nglobal.set(\"playback_counter\", 0);\nmsg.payload = length_array;\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":580,"wires":[["c81da2df.686d5","635b6e2c.8fe8a"]]},{"id":"15487235.16994e","type":"fs-file-lister","z":"1b66da0f.f06f66","name":"","start":"/","pattern":"*","path":true,"single":true,"depth":0,"stat":false,"x":560,"y":160,"wires":[["66a65224.bb3e5c"]]},{"id":"74c68286.39592c","type":"ui_colour_picker","z":"1b66da0f.f06f66","name":"Play Solid Color Picker","label":"Play Solid Color","group":"5215622d.76e2dc","format":"hex","outformat":"string","showSwatch":true,"showPicker":true,"showValue":true,"showHue":true,"showAlpha":false,"showLightness":true,"dynOutput":"true","order":0,"width":0,"height":0,"passthru":false,"topic":"","x":1240,"y":260,"wires":[["654f640a.41ac2c"]]},{"id":"654f640a.41ac2c","type":"function","z":"1b66da0f.f06f66","name":"Format Play Color Command","func":"msg.payload = \"PLAY 1-0 #\" + msg.payload;\nreturn msg;","outputs":1,"noerr":0,"x":1540,"y":260,"wires":[["3146197c.7560c6","cfcb4134.7ea64"]]},{"id":"5cea7ea1.4d8ea","type":"ffprobe","z":"1b66da0f.f06f66","name":"ffprobe next file","prefix":"","x":1420,"y":900,"wires":[["2b7ef937.baf966"]]},{"id":"21ca9b37.e40094","type":"function","z":"1b66da0f.f06f66","name":"Play Now and Cue Next","func":"var playback_counter = global.get(\"playback_counter\");\nvar playback_list = global.get(\"playback_list\");\nvar master_list = global.get(\"master_list\");\nvar local_path = global.get(\"local_path\");\nvar play_now = global.get(\"play_next\");\nvar play_next = {};\nvar duration = {};\n\nfunction shuffle(array) {\n var i = array.length,\n j = 0,\n temp;\n\n while (i--) {\n\n j = Math.floor(Math.random() * (i+1));\n\n // swap randomly chosen element with current element\n temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n\n }\n\n return array;\n}\n \nif (playback_counter < playback_list.length) {\n \n playback_counter++;\n}\nelse {\n var playback_type = global.get(\"playback_type\");\n if(playback_type===\"random\"){\n var random_order = shuffle(length_array);\n global.set(\"playback_list\", random_order);\n playback_list = random_order;\n }\n playback_counter = 0; \n}\nvar list_index = playback_list[playback_counter];\nplay_next.payload = master_list[list_index];\nplay_next.local_name = local_path + master_list[list_index].replace(/^.*[\\\\\\/]/, '');\nglobal.set(\"play_next\", play_next);\nglobal.set(\"play_now\", play_now);\nglobal.set(\"playback_counter\", playback_counter);\nduration.payload = play_now.duration;\nreturn [play_now, play_next];\n\n","outputs":2,"noerr":0,"x":1150,"y":760,"wires":[["b857f917.93d4e8","ed7114b8.ef43a8","f3d9f82a.4944e8","168f750e.f2519b","1dd46e83.239091","33473c23.c26404"],["5cea7ea1.4d8ea","c4e3c38b.b7224"]]},{"id":"ed7114b8.ef43a8","type":"function","z":"1b66da0f.f06f66","name":"filter ffprobe to get duration by type","func":"var secs = msg.duration;\nvar codec = msg.codec_name;\nvar duration = {};\nif ((secs===0.0) && ((codec == \"png\" ) || (codec == \"mjpeg\"))) {\n duration.delay = 4000;\n}\nelse {\n duration.delay = secs*1000 ;\n}\nreturn duration;","outputs":1,"noerr":0,"x":1520,"y":740,"wires":[["2877d1cf.e28b2e"]]},{"id":"2877d1cf.e28b2e","type":"delay","z":"1b66da0f.f06f66","name":"File Length Delay","pauseType":"delayv","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1890,"y":780,"wires":[["21ca9b37.e40094"]]},{"id":"b857f917.93d4e8","type":"function","z":"1b66da0f.f06f66","name":"Format Play Command","func":"var play_command = {};\nplay_command.payload = \"PLAY 1-0 \" + msg.local_name;\nreturn play_command;","outputs":1,"noerr":0,"x":1490,"y":560,"wires":[["cfcb4134.7ea64"]]},{"id":"71d64e8e.0752e","type":"ui_template","z":"1b66da0f.f06f66","group":"c189975a.add948","name":"","order":0,"width":0,"height":0,"format":"<div class=\"row\">\n <div class=\"column\">\n <div id=\"selectSource\">\n <input type=\"file\" name=\"folderName\" id=\"folderName\" class=\"inputfile\" webkitdirectory />\n <label for=\"folderName\"><i class=\"fa fa-folder-open-o\"></i> Select a Source Directory</label>\n </div>\n </div>\n <div class=\"column\">\n <input type=\"text\" id=\"sourceDirPath\" class=\"myInput\" />\n </div>\n </div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":140,"y":380,"wires":[["56f54613.af88f8"]]},{"id":"56f54613.af88f8","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":320,"y":380,"wires":[]},{"id":"5737a0e8.563ba","type":"ui_template","z":"1b66da0f.f06f66","group":"c189975a.add948","name":"","order":0,"width":0,"height":0,"format":"<input type=\"file\" id=\"filepicker\" name=\"fileList\" webkitdirectory multiple />\n<ul id=\"listing\"></ul>\n\n<script>\n document.getElementById(\"filepicker\").addEventListener(\"change\", function(event) {\n let output = document.getElementById(\"listing\");\n let files = event.target.files;\n\n for (let i=0; i<files.length; i++) {\n let item = document.createElement(\"li\");\n item.innerHTML = files[i].webkitRelativePath;\n output.appendChild(item);\n };\n}, false);\n</script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":140,"y":320,"wires":[["5d9bcdbf.66b914"]]},{"id":"5d9bcdbf.66b914","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":320,"y":320,"wires":[]},{"id":"b5d9d5e.fb36428","type":"ui_template","z":"1b66da0f.f06f66","group":"c189975a.add948","name":"","order":0,"width":0,"height":0,"format":"<input type=\"file\" multiple>\n\n\n\n<script>\nfunction onChange(e) {\n e.stopPropagation();\n e.preventDefault();\n\n var entries = e.target.webkitEntries; // Get all dropped items as FS API entries.\n\n [].forEach.call(entries, function(entry) {\n\n // Copy the entry into our local filesystem.\n entry.copyTo(fs.root, null, function(copiedEntry) {\n ...\n }, onError);\n\n });\n}\n\ndocument.querySelector('input[type=\"file\"]').addEventListener('change', onChange);\n</script>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":140,"y":440,"wires":[["eefcaed1.2054c"]]},{"id":"eefcaed1.2054c","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":320,"y":440,"wires":[]},{"id":"245c3f34.7258e","type":"ui_button","z":"1b66da0f.f06f66","name":"Play Next in Playlist","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"passthru":false,"label":"NEXT >>","color":"","bgcolor":"","icon":"","payload":"reset","payloadType":"str","topic":"","x":1610,"y":840,"wires":[["2877d1cf.e28b2e"]]},{"id":"f747c648.fecfa8","type":"inject","z":"1b66da0f.f06f66","name":"Next >>","topic":"","payload":"reset","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1650,"y":800,"wires":[["2877d1cf.e28b2e"]]},{"id":"c81da2df.686d5","type":"function","z":"1b66da0f.f06f66","name":"Set First Item in List","func":"var playback_list = global.get(\"playback_list\");\nvar master_list = global.get(\"master_list\");\nvar local_path = global.get(\"local_path\");\n\nvar play_next = {};\n\nvar list_index = playback_list[0];\n\nplay_next.payload = master_list[list_index];\nplay_next.local_name = local_path + master_list[list_index].replace(/^.*[\\\\\\/]/, '');\nglobal.set(\"playback_counter\", 0);\nglobal.set(\"play_next\", play_next);\n\nreturn [play_next];\n\n","outputs":1,"noerr":0,"x":440,"y":760,"wires":[["fd5aa909.c837d8"]]},{"id":"fd5aa909.c837d8","type":"ffprobe","z":"1b66da0f.f06f66","name":"ffprobe first item","prefix":"","x":640,"y":760,"wires":[["75d48a54.4fca54"]]},{"id":"75d48a54.4fca54","type":"function","z":"1b66da0f.f06f66","name":"Save Duration to global play_next","func":"var play_next = global.get(\"play_next\");\nplay_next.duration = msg.payload.duration;\nplay_next.codec_name = msg.payload.codec_name;\nglobal.set(\"play_next\", play_next);\nreturn play_next;","outputs":1,"noerr":0,"x":880,"y":760,"wires":[["21ca9b37.e40094"]]},{"id":"2b7ef937.baf966","type":"function","z":"1b66da0f.f06f66","name":"Save Duration to global play_next","func":"var play_next = global.get(\"play_next\");\nplay_next.duration = msg.payload.duration;\nplay_next.codec_name = msg.payload.codec_name;\nglobal.set(\"play_next\", play_next);\n","outputs":1,"noerr":0,"x":1660,"y":900,"wires":[[]]},{"id":"f3d9f82a.4944e8","type":"debug","z":"1b66da0f.f06f66","name":"play file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1400,"y":800,"wires":[]},{"id":"c4e3c38b.b7224","type":"debug","z":"1b66da0f.f06f66","name":"play file","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1400,"y":840,"wires":[]},{"id":"168f750e.f2519b","type":"ui_text","z":"1b66da0f.f06f66","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"name":"","label":"Currently Playing:","format":"{{msg.local_name}}","layout":"row-left","x":1510,"y":600,"wires":[]},{"id":"65a9b87f.6e57f8","type":"ui_text","z":"1b66da0f.f06f66","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"name":"Duration","label":"Duration","format":"{{msg.payload}}","layout":"row-left","x":1700,"y":640,"wires":[]},{"id":"1dd46e83.239091","type":"ui_text","z":"1b66da0f.f06f66","group":"5215622d.76e2dc","order":0,"width":0,"height":0,"name":"Codec Name","label":"Codec Name","format":"{{msg.codec_name}}","layout":"row-left","x":1490,"y":680,"wires":[]},{"id":"33473c23.c26404","type":"function","z":"1b66da0f.f06f66","name":"Format Seconds to h m s","func":"var secs = msg.duration;\nvar hours = Math.floor(secs / (60 * 60));\n\nvar divisor_for_minutes = secs % (60 * 60);\nvar minutes = Math.floor(divisor_for_minutes / 60);\n\nvar divisor_for_seconds = divisor_for_minutes % 60;\nvar seconds = (Math.round(divisor_for_seconds * 10) / 10).toFixed(1);\n//var seconds = Math.ceil(divisor_for_seconds);\n\nvar time = hours + 'h:' + minutes + 'm:' + seconds + 's';\n\nmsg.payload = time;\n\nreturn [msg];","outputs":1,"noerr":0,"x":1490,"y":640,"wires":[["65a9b87f.6e57f8"]]},{"id":"a34d4427.77bea8","type":"ui_template","z":"1b66da0f.f06f66","group":"5215622d.76e2dc","name":"","order":0,"width":"6","height":"6","format":"<h4>Play List:</h4>\n<p ng-repeat=\"row in msg.payload\">{{row}}</p>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":1040,"y":600,"wires":[[]]},{"id":"635b6e2c.8fe8a","type":"function","z":"1b66da0f.f06f66","name":"format list for UI","func":"var playback_list = global.get(\"playback_list\");\nvar master_list = global.get(\"master_list\");\nvar local_path = global.get(\"local_path\");\nvar playlist = [];\nfor(var i=0; i<playback_list.length; i++) {\n playlist[i] = local_path + master_list[playback_list[i]].replace(/^.*[\\\\\\/]/, '');\n}\nmsg.payload = playlist;\nreturn msg;","outputs":1,"noerr":0,"x":840,"y":600,"wires":[["a34d4427.77bea8"]]},{"id":"f646a28a.de1b3","type":"google calendar in","z":"1b66da0f.f06f66","google":"","name":"","calendar":"KCAT","offsetType":"at","offsetFrom":"start","offset":"10","offsetUnits":"minutes","x":2520,"y":580,"wires":[["a8482e73.5f75f"]]},{"id":"26337913.283a66","type":"inject","z":"1b66da0f.f06f66","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":2510,"y":360,"wires":[["5d213ede.da9d4","b6557698.ffeaa8"]]},{"id":"a8482e73.5f75f","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":2780,"y":580,"wires":[]},{"id":"af65ec85.a8852","type":"ui_template","z":"1b66da0f.f06f66","group":"a6324799.0c5418","name":"Embedded Calendar","order":0,"width":0,"height":0,"format":"<div><iframe src=\"https://calendar.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23FFFFFF&src=ucsc.edu_t28pspne661saq2bd3ckgp52vg%40group.calendar.google.com&color=%23865A5A&ctz=America%2FLos_Angeles\" style=\"border-width:0\" width=\"800\" height=\"600\" frameborder=\"0\" scrolling=\"no\"></iframe></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":3160,"y":260,"wires":[[]]},{"id":"8ae9da90.23b6c8","type":"ui_text_input","z":"1b66da0f.f06f66","name":"Time Picker","label":"Select Time","group":"191211e4.b7790e","order":7,"width":0,"height":0,"passthru":true,"mode":"time","delay":"0","topic":"","x":2510,"y":300,"wires":[["66079db1.c2ab54","655fac55.688d74"]]},{"id":"b7b869dd.598008","type":"ui_date_picker","z":"1b66da0f.f06f66","name":"Date Picker","label":"Select Date","group":"191211e4.b7790e","order":6,"width":0,"height":0,"passthru":true,"topic":"","x":2510,"y":260,"wires":[["66079db1.c2ab54","9be3cd42.9991b"]]},{"id":"66079db1.c2ab54","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3170,"y":220,"wires":[]},{"id":"9be3cd42.9991b","type":"function","z":"1b66da0f.f06f66","name":"","func":"global.set(\"datestamp\", msg.payload);\n\nreturn msg;","outputs":1,"noerr":0,"x":2710,"y":220,"wires":[["67a58f1c.1b5c6"]]},{"id":"655fac55.688d74","type":"function","z":"1b66da0f.f06f66","name":"","func":"global.set(\"timestamp\", msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":2710,"y":320,"wires":[["67a58f1c.1b5c6"]]},{"id":"b4ec4c4c.256be","type":"function","z":"1b66da0f.f06f66","name":"","func":"var start_time = Number(global.get(\"datetimestamp\"));\nvar end_time = Number(start_time) + Math.floor(global.get(\"file_length\"));\nvar abs_path = global.get(\"full_path_file\");\nvar date_time = toDateTime(Number(start_time));\nvar end_date_time = toDateTime(Number(end_time));\n\nmsg.payload = {\n \"kind\": \"calendar#event\",\n 'summary': 'KCAT VIDEO',\n 'description': abs_path,\n 'start': {\n 'dateTime': date_time,\n 'timeZone': 'America/Los_Angeles'\n },\n 'end': {\n 'dateTime': end_date_time,\n 'timeZone': 'America/Los_Angeles'\n }\n};\n\n\nreturn msg;\n\nfunction toDateTime(secs) {\n var t = new Date(1970, 0, 1); // Epoch\n t.setSeconds(secs);\n return t;\n}","outputs":1,"noerr":0,"x":2530,"y":440,"wires":[["a8482e73.5f75f","b6557698.ffeaa8"]]},{"id":"81cd487f.ec9728","type":"ui_button","z":"1b66da0f.f06f66","name":"Schedule Show Button","group":"191211e4.b7790e","order":8,"width":0,"height":0,"passthru":false,"label":"Schedule Show","color":"","bgcolor":"","icon":"","payload":"","payloadType":"str","topic":"","x":2360,"y":440,"wires":[["b4ec4c4c.256be"]]},{"id":"5d213ede.da9d4","type":"debug","z":"1b66da0f.f06f66","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":3000,"y":380,"wires":[]},{"id":"67a58f1c.1b5c6","type":"function","z":"1b66da0f.f06f66","name":"","func":"var datetime = global.get(\"timestamp\") + global.get(\"datestamp\");\nglobal.set(\"datetimestamp\", datetime );\nmsg.payload = datetime;\nreturn msg;","outputs":1,"noerr":0,"x":2860,"y":280,"wires":[[]]},{"id":"994967e5.242138","type":"inject","z":"1b66da0f.f06f66","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":2400,"y":500,"wires":[["b4ec4c4c.256be"]]},{"id":"c7f1cdc7.d2f53","type":"function","z":"1b66da0f.f06f66","name":"set defaul date and time stamps","func":"global.set(\"datestamp\", 0);\nglobal.set(\"timstamp\", 0);\nglobal.set(\"datetimestamp\", 0);\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":100,"wires":[[]]},{"id":"b6557698.ffeaa8","type":"google calendar out","z":"1b66da0f.f06f66","google":"","name":"","calendar":"KCAT","x":2770,"y":400,"wires":[]},{"id":"c189975a.add948","type":"ui_group","z":"","name":"Files","tab":"cbf2cdd8.4f3de","order":1,"disp":true,"width":"6","collapse":false},{"id":"191211e4.b7790e","type":"ui_group","z":"","name":"File Info","tab":"cbf2cdd8.4f3de","order":4,"disp":true,"width":"6","collapse":true},{"id":"5215622d.76e2dc","type":"ui_group","z":"","name":"Play Videos","tab":"cbf2cdd8.4f3de","order":5,"disp":true,"width":"6","collapse":false},{"id":"a6324799.0c5418","type":"ui_group","z":"","name":"BROADCAST SCHEDULE","tab":"d130edee.68e35","order":1,"disp":true,"width":"24","collapse":false},{"id":"cbf2cdd8.4f3de","type":"ui_tab","z":"","name":"Media Library","icon":"dashboard","order":2},{"id":"d130edee.68e35","type":"ui_tab","z":"","name":"Schedule","icon":"dashboard","order":2}]