Comments (10)
Ok no worries Ben - I'll do some digging and let you know if I find anything. Otherwise I'll assume it's down to their Windows hosting. Thank you for your time :)
from craft-embedded-assets.
Hey Daryl, thanks for the report!
The fileinfo
extension needs to be enabled. If there's a warning sign next to it, it might be an old or broken version of the extension.
Funnily enough, I only introduced the need for the fileinfo
extension to fix a bug (#17) about mime_content_type()
not working in some later versions of PHP (5.3+). It wouldn't be hard to add back in mime_content_type()
as a fallback.
from craft-embedded-assets.
Thanks Ben - it's not a site I host so I've put in a request to their company to enable it. Any idea off the top of your head if there's a specific version of it that needs to be enabled?
from craft-embedded-assets.
Unfortunately, I can't say what it could be. I figured with it fresh in my mind, and being an easy fix, I've gone ahead and written a fallback if the fileinfo
extension isn't usable. It should be available on the master branch. Let me know if it does or doesn't work 👍
from craft-embedded-assets.
Thanks Ben. That seems to let me upload assets again, but I can't get them to display in my template. Your example code has worked fine on other sites, so I'm wondering if there's an issue with the uploaded files or detection.
{% for video in block.asset %}
<p>{{ video.title }}</p>
{% set embed = craft.embeddedAssets.fromAsset(video) %}
<p>Length: {{ embed|length }}</p>
{% if embed %}
{{ embed.safeHtml|raw }}
{% endif %}
{% endfor %}
The code above outputs the video's title, so Craft knows the asset is there and exists, but it also outputs Length: 0
, so it looks like EA isn't recognising it as an asset. Am I correct in thinking that's what's going on? Where am I going wrong?
from craft-embedded-assets.
Hm, that's interesting. It seems like the file isn't being read. I'm using two methods of reading the contents of the JSON file, through cURL
, and file_get_contents
as a fallback. Pretty low chance of both of those not being available, but it might be the case. Do you know if the curl
extension is enabled?
from craft-embedded-assets.
cURL support has a green tick next to it in /utils
from craft-embedded-assets.
Also, just to be safe, can you check the contents of the JSON file that gets generated? Want to make sure it's being uploaded okay.
from craft-embedded-assets.
Contents of test json file:
{"type":"video","url":"http:\/\/www.youtube.com\/watch?v=LBc7X8gMPwg","requestUrl":"https:\/\/www.youtube.com\/watch?v=LBc7X8gMPwg","title":"Dreamstate Logic - Galaxy's Child","description":"In order to more fully understand this reality, we must take into account other dimensions of a broader reality, the introduction of higher dimensions of con...","authorName":"SpaceAmbient","authorUrl":"https:\/\/www.youtube.com\/user\/SpaceAmbient","providerName":"YouTube","providerUrl":"https:\/\/www.youtube.com\/","cacheAge":"","thumbnailUrl":"https:\/\/i.ytimg.com\/vi\/LBc7X8gMPwg\/hqdefault.jpg","thumbnailWidth":"480","thumbnailHeight":"360","html":"<iframe width=\"1280\" height=\"720\" src=\"https:\/\/www.youtube.com\/embed\/LBc7X8gMPwg?feature=oembed\" frameborder=\"0\" allowfullscreen><\/iframe>","safeHtml":"<iframe width=\"1280\" height=\"720\" src=\"https:\/\/www.youtube.com\/embed\/LBc7X8gMPwg?feature=oembed\" frameborder=\"0\"><\/iframe>","width":"1280","height":"720","__embeddedasset__":true}
from craft-embedded-assets.
Everything seems like it should be fine. Clearly the problem is in reading the file, but I'm not sure why that would be failing. If you locate the _readExternalFile
method in EmbeddedAssetsService, this is where the file is being read. Try adding in some var_dump(); exit;
's on some of the variables, to see where it's breaking. curl_error()
might be throwing an error that I'm just ignoring.
Sorry I can't be much more of a help!
from craft-embedded-assets.
Related Issues (20)
- Aspect ratio is in an unexpected form HOT 2
- EmbeddedAssetImage's size attribute has an unexpected value HOT 4
- Embed\Exceptions\InvalidUrlException: Invalid url ... (Status code 429) HOT 1
- Craft 5 compatibility HOT 1
- Where is the full documentation? HOT 1
- Lots of depreciation errors with latest update HOT 7
- craft.embeddedAssets.get() returns null for embed uploaded prior to 4.0 upgrade HOT 5
- How to embed multiple YouTube videos? HOT 3
- Embedding Google Maps produces an error HOT 11
- Open Street Map extractor HOT 1
- Bluesky extractor HOT 1
- Youtube Maxres Thumbnail HOT 1
- Getting ahead of security changes for Vimeo HOT 1
- Instagram renders as text HOT 3
- Embed\Http\NetworkException Error code 23 HOT 1
- Vimeo URLs showing "Vimeo / CAPTCHA Challenge" HOT 5
- No longer able to embed anything HOT 3
- Create an Embedded Asset by Passing a Url via template Code
- Could not retrieve embed information HOT 2
- Ability to manually refresh an asset
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from craft-embedded-assets.