You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got the following chunk of code to output the asset using this plugin if it's embedded, and insert the link into an HTML video tag if it's a local file:
{% for asset in block.video %} {% set embed = craft.embeddedAssets.fromAsset(asset) %} {% if embed %} {{ embed.safeHtml|raw }} {% else %} <video controls> <source src="{{ asset.url }}" type="{{ asset.getMimeType() }}"> </video> {% endif %} {% endfor %}
It works perfectly on my local MAMP server, and on my staging site, recognizing the asset as embedded and outputting the proper code. When I push to the live site (hosted with Media Temple), however, it's not recognizing the asset as embedded, and outputting the code under "else" resulting in the follow broken code:
I've double checked the template on the server, it's the exact same as my working local version. Changing the server's PHP version to 7 doesn't fix it. I don't understand what could be happening here. I've also tried this:
{% if craft.embeddedAssets.isEmbedded(asset) %}
Which, again, works locally but not on the live site. This is driving me nuts.
Edit: For some reason, the live site is uploading them as JSON instead of embedded assets
Local site:
Live site:
The text was updated successfully, but these errors were encountered:
Embedded assets are JSON files, so that's all good. It seems reading the source of the JSON files is the problem. This might be caused by file permissions. Your assets may have had their read permissions changed when uploading them. Make sure they're set to 0755 and try again.
I've got the following chunk of code to output the asset using this plugin if it's embedded, and insert the link into an HTML video tag if it's a local file:
{% for asset in block.video %} {% set embed = craft.embeddedAssets.fromAsset(asset) %} {% if embed %} {{ embed.safeHtml|raw }} {% else %} <video controls> <source src="{{ asset.url }}" type="{{ asset.getMimeType() }}"> </video> {% endif %} {% endfor %}
It works perfectly on my local MAMP server, and on my staging site, recognizing the asset as embedded and outputting the proper code. When I push to the live site (hosted with Media Temple), however, it's not recognizing the asset as embedded, and outputting the code under "else" resulting in the follow broken code:
<source src="/assets/vid/embed_Sporting-Life-Powder-Matt.json" type="application/json">
I've double checked the template on the server, it's the exact same as my working local version. Changing the server's PHP version to 7 doesn't fix it. I don't understand what could be happening here. I've also tried this:
{% if craft.embeddedAssets.isEmbedded(asset) %}
Which, again, works locally but not on the live site. This is driving me nuts.
Edit: For some reason, the live site is uploading them as JSON instead of embedded assets
Local site:
Live site:
The text was updated successfully, but these errors were encountered: