You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
3.6 KiB

{"ast":null,"code":"import { createElementObject, createLayerComponent, extendContext, updateMediaOverlay } from '@react-leaflet/core';\nimport { VideoOverlay as LeafletVideoOverlay } from 'leaflet';\nexport const VideoOverlay = createLayerComponent(function createVideoOverlay(_ref, ctx) {\n let {\n bounds,\n url,\n ...options\n } = _ref;\n const overlay = new LeafletVideoOverlay(url, bounds, options);\n\n if (options.play === true) {\n overlay.getElement()?.play();\n }\n\n return createElementObject(overlay, extendContext(ctx, {\n overlayContainer: overlay\n }));\n}, function updateVideoOverlay(overlay, props, prevProps) {\n updateMediaOverlay(overlay, props, prevProps);\n\n if (typeof props.url === 'string' && props.url !== prevProps.url) {\n overlay.setUrl(props.url);\n }\n\n const video = overlay.getElement();\n\n if (video != null) {\n if (props.play === true && !prevProps.play) {\n video.play();\n } else if (!props.play && prevProps.play === true) {\n video.pause();\n }\n }\n});","map":{"version":3,"names":["createElementObject","createLayerComponent","extendContext","updateMediaOverlay","VideoOverlay","LeafletVideoOverlay","createVideoOverlay","ctx","bounds","url","options","overlay","play","getElement","overlayContainer","updateVideoOverlay","props","prevProps","setUrl","video","pause"],"sources":["/Users/mahdi/Documents/work/programming/barnameNegar/arbaeenWebApp/node_modules/react-leaflet/lib/VideoOverlay.js"],"sourcesContent":["import { createElementObject, createLayerComponent, extendContext, updateMediaOverlay } from '@react-leaflet/core';\nimport { VideoOverlay as LeafletVideoOverlay } from 'leaflet';\nexport const VideoOverlay = createLayerComponent(function createVideoOverlay({ bounds , url , ...options }, ctx) {\n const overlay = new LeafletVideoOverlay(url, bounds, options);\n if (options.play === true) {\n overlay.getElement()?.play();\n }\n return createElementObject(overlay, extendContext(ctx, {\n overlayContainer: overlay\n }));\n}, function updateVideoOverlay(overlay, props, prevProps) {\n updateMediaOverlay(overlay, props, prevProps);\n if (typeof props.url === 'string' && props.url !== prevProps.url) {\n overlay.setUrl(props.url);\n }\n const video = overlay.getElement();\n if (video != null) {\n if (props.play === true && !prevProps.play) {\n video.play();\n } else if (!props.play && prevProps.play === true) {\n video.pause();\n }\n }\n});\n"],"mappings":"AAAA,SAASA,mBAAT,EAA8BC,oBAA9B,EAAoDC,aAApD,EAAmEC,kBAAnE,QAA6F,qBAA7F;AACA,SAASC,YAAY,IAAIC,mBAAzB,QAAoD,SAApD;AACA,OAAO,MAAMD,YAAY,GAAGH,oBAAoB,CAAC,SAASK,kBAAT,OAA2DC,GAA3D,EAAgE;EAAA,IAApC;IAAEC,MAAF;IAAWC,GAAX;IAAiB,GAAGC;EAApB,CAAoC;EAC7G,MAAMC,OAAO,GAAG,IAAIN,mBAAJ,CAAwBI,GAAxB,EAA6BD,MAA7B,EAAqCE,OAArC,CAAhB;;EACA,IAAIA,OAAO,CAACE,IAAR,KAAiB,IAArB,EAA2B;IACvBD,OAAO,CAACE,UAAR,IAAsBD,IAAtB;EACH;;EACD,OAAOZ,mBAAmB,CAACW,OAAD,EAAUT,aAAa,CAACK,GAAD,EAAM;IACnDO,gBAAgB,EAAEH;EADiC,CAAN,CAAvB,CAA1B;AAGH,CAR+C,EAQ7C,SAASI,kBAAT,CAA4BJ,OAA5B,EAAqCK,KAArC,EAA4CC,SAA5C,EAAuD;EACtDd,kBAAkB,CAACQ,OAAD,EAAUK,KAAV,EAAiBC,SAAjB,CAAlB;;EACA,IAAI,OAAOD,KAAK,CAACP,GAAb,KAAqB,QAArB,IAAiCO,KAAK,CAACP,GAAN,KAAcQ,SAAS,CAACR,GAA7D,EAAkE;IAC9DE,OAAO,CAACO,MAAR,CAAeF,KAAK,CAACP,GAArB;EACH;;EACD,MAAMU,KAAK,GAAGR,OAAO,CAACE,UAAR,EAAd;;EACA,IAAIM,KAAK,IAAI,IAAb,EAAmB;IACf,IAAIH,KAAK,CAACJ,IAAN,KAAe,IAAf,IAAuB,CAACK,SAAS,CAACL,IAAtC,EAA4C;MACxCO,KAAK,CAACP,IAAN;IACH,CAFD,MAEO,IAAI,CAACI,KAAK,CAACJ,IAAP,IAAeK,SAAS,CAACL,IAAV,KAAmB,IAAtC,EAA4C;MAC/CO,KAAK,CAACC,KAAN;IACH;EACJ;AACJ,CArB+C,CAAzC"},"metadata":{},"sourceType":"module"}