From 2b51bc4bfa86863ed14b550fe3281840587ab038 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 12 Nov 2017 02:48:36 -0500 Subject: enhancement/video-player (#480) * Add toolbar visibility toggle and draw it over viewer * Set contract bindings once available * Fix video url param error and prepare progressanimator * Add gif support and better transitions * Interface a lot of things * Reorder back press * Clean up files and fix selector * Add gif support * Redraw bounds when necessary --- app/src/main/assets/js/media.js | 6 +++--- app/src/main/assets/js/media.min.js | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'app/src/main/assets') diff --git a/app/src/main/assets/js/media.js b/app/src/main/assets/js/media.js index 852a1e8c..f1a5ac3c 100644 --- a/app/src/main/assets/js/media.js +++ b/app/src/main/assets/js/media.js @@ -9,7 +9,7 @@ if (!window.hasOwnProperty('frost_media')) { * Commonality; check for valid target */ var element = e.target || e.srcElement; - if (!element.hasAttribute("data-sigil") || !element.getAttribute("data-sigil").includes("playInlineVideo")) return; + if (!element.hasAttribute("data-sigil") || !element.getAttribute("data-sigil").toLowerCase().includes("inlinevideo")) return; console.log("Found inline video"); element = element.parentNode; if (!element.hasAttribute("data-store")) return; @@ -20,8 +20,8 @@ if (!window.hasOwnProperty('frost_media')) { return; } if (!dataStore.src) return; - console.log("Inline video", dataStore.src); - if (typeof Frost !== 'undefined') Frost.loadVideo(dataStore.src); + console.log("Inline video " + dataStore.src); + if (typeof Frost !== 'undefined') Frost.loadVideo(dataStore.src, dataStore.animatedGifVideo); e.stopPropagation(); e.preventDefault(); return; diff --git a/app/src/main/assets/js/media.min.js b/app/src/main/assets/js/media.min.js index c965f515..767b8a36 100644 --- a/app/src/main/assets/js/media.min.js +++ b/app/src/main/assets/js/media.min.js @@ -1,20 +1,20 @@ if(!window.hasOwnProperty("frost_media")){ console.log("Registering frost_media"), window.frost_media=!0 -;var _frostMediaClick=function(t){ -var e=t.target||t.srcElement -;if(e.hasAttribute("data-sigil")&&e.getAttribute("data-sigil").includes("playInlineVideo")&&(console.log("Found inline video"), -e=e.parentNode, -e.hasAttribute("data-store"))){ +;var _frostMediaClick=function(e){ +var t=e.target||e.srcElement +;if(t.hasAttribute("data-sigil")&&t.getAttribute("data-sigil").toLowerCase().includes("inlinevideo")&&(console.log("Found inline video"), +t=t.parentNode, +t.hasAttribute("data-store"))){ var i ;try{ -i=JSON.parse(e.getAttribute("data-store")) -}catch(t){ +i=JSON.parse(t.getAttribute("data-store")) +}catch(e){ return } -i.src&&(console.log("Inline video",i.src),"undefined"!=typeof Frost&&Frost.loadVideo(i.src), -t.stopPropagation(), -t.preventDefault()) +i.src&&(console.log("Inline video "+i.src),"undefined"!=typeof Frost&&Frost.loadVideo(i.src,i.animatedGifVideo), +e.stopPropagation(), +e.preventDefault()) } } ;document.addEventListener("click",_frostMediaClick,!0) -- cgit v1.2.3