Closed johnwbaxter closed 4 years ago
getVideoCode()
should only fail if the embedded asset is not a video, or if it's not passed an array of parameters, which your template code does have, so at the moment I'm thinking it hasn't been detected as a video somehow. If you try vid.type
, what does that output?
Ah! It shows as a link rather than a video. I think the user added a video with a youtube link that has a time set on it. It seems to have pulled in all the meta info correctly though!
It should still detect it as a video if the time is set (it should just discard the time), so it's definitely a bug if that isn't happening in a particular case.
If you select the video on the asset index page and use the Replace button to replace the video with its own URL, does that get detected as a video? If not, could you please let us know the video URL you're trying to add, either here or at plugins@spicyweb.com.au and we'll have a look at what's happening with it.
Closing this issue now -- hopefully you've sorted everything out, but if the issue persists, please let us know the previously-requested information and we'll reopen the issue.
@ttempleton I'm having a similar issue where a YouTube video is being detected as type=link.
Here's the YouTube URL: https://www.youtube.com/watch?v=bT0YpOmk8NA
I have tried adding it as a new asset a few times and get the same thing.
We're on version 2.4.2 with Craft 3.5.13.2.
@siffring @ttempleton Hey both, I forgot to update this! I found the reason it was doing this was because the video was configured in YouTube to not be allowed to be embedded on other websites. So Jason, check the settings on that YouTube video!!
Ah! It looks like that is the case here too! Not sure if that's something the plugin can check for or not. Thanks for the info!
No worries!!!
Description
I've added a public YouTube video and it causes an error. Stacktrace below
My template code is:
{% set vid = craft.embeddedAssets.get(block.video.one()) %} {{ vid.getVideoCode(['autoplay=0', 'controls=1', 'playsinline=0']) }}
I have tried vid.title and vid.url and they output the right info, so the embed has worked, but that method isn't.
Steps to reproduce
Other information