1
|
[{"sinternet archive video":{"url":"","hash":"","text":"/**\n * Copyright 2021 Wojtek Kosior\n *\n * This program is free software; you can redistribute it\n * and/or modify it under the terms of either:\n * - the GNU General Public License as published by the Free\n * Software Foundation; either version 3 of the License, or (at\n * your option) any later version, or\n * - the \"A\" license: <https://koszko.org/alicense.txt>; explained\n * at: <https://koszko.org/en/articles/my-new-license.html>\n *\n * As additional permission under GNU GPL version 3 section 7, you\n * may distribute forms of that code without the copy of the GNU\n * GPL normally required by section 4, provided you include this\n * license notice and, in case of non-source distribution, a URL\n * through which recipients can access the Corresponding Source.\n * If you modify file(s) with this exception, you may extend this\n * exception to your version of the file(s), but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version. If you delete this\n * exception statement from all source files in the program, then\n * also delete it here.\n *\n * As a special exception to the GPL, any HTML file which merely\n * makes function calls to this code, and for that purpose\n * includes it by reference shall be deemed a separate work for\n * copyright law purposes. If you modify this code, you may extend\n * this exception to your version of the code, but you are not\n * obligated to do so. If you do not wish to do so, delete this\n * exception statement from your version.\n */\n\nconst theatre_ia = document.getElementById(\"theatre-ia\");\n\nlet srcs = [];\n\nlet ogv_src = null;\nlet webm_src = null;\nlet mp4_src = null;\n\nfunction process_link(link)\n{\n ogv_src = ogv_src || (/\\.ogv$/.test(link) && link);\n webm_src = webm_src || (/\\.webm$/.test(link) && link);\n mp4_src = mp4_src || (/\\.mp4$/.test(link) && link);\n}\n\nif (theatre_ia) {\n for (const a of\n\t document.querySelectorAll(\".item-download-options a.download-pill\"))\n\tprocess_link(a.href);\n\n for (const link of document.querySelectorAll(\"link[itemprop=contentUrl]\"))\n\tprocess_link(link.href);\n\n srcs = [\n\t{src: ogv_src, type: \"video/ogg\"},\n\t{src: webm_src, type: \"video/webm\"},\n\t{src: mp4_src, type: \"video/mp4\"}\n ].filter(src => src.src);\n}\n\nif (srcs.length > 0) {\n const video = document.createElement(\"video\");\n\n for (const src of srcs) {\n\tconst source = document.createElement(\"source\");\n\tObject.assign(source, src);\n\tvideo.appendChild(source);\n }\n\n video.setAttribute(\"width\", \"100%\");\n video.setAttribute(\"height\", \"auto\");\n video.setAttribute(\"controls\", \"\");\n\n for (const child of theatre_ia.children)\n\tchild.remove();\n\n theatre_ia.appendChild(video);\n}\n"}},{"phttps://archive.org/details/*":{"components":["s","internet archive video"],"allow":false}}]
|