craft-transcoder
craft-transcoder copied to clipboard
[FR] GraphQL Support
I can't find anything in the documentation: Can this plugin be used to include transcoded video url fields via GraphQL directly for an asset?
For example something like url @transcode(…)
would be great.
{
asset(kind: "video") {
title
url @transcoder(width:768 ,videoBitRate:"500k")
}
}
@khalwat I guess this has no priority?
It isn't something I'd planned to implement, but if enough people are interested, sure.
Understand if the video is in the middle of transcoding, you'll get nothing back. But I suppose that's not much different than the current Twig API.
alright, thanks for that information. then I hope there are people out there requesting this feature as well.
For anyone searching for a temporary solution, I used the Preparse Field Plugin that I added to the asset entry type to trigger the video transcoding. Here is the twig code I used to create a mp4 version of a video:
{% set myAsset = craft.assets().uid(element.uid).one() %}
{% if myAsset.kind == 'video' %}
{% set mp4 = craft.transcoder.getVideoUrl(myAsset, {
"width": "",
"height": "",
}) %}
{{ { 'mp4': mp4 } | json_encode }}
{% endif %}
@khalwat are there events I could listen to inside a custom module to trigger a resave of that field when the transcoding is finished? Could not find anything in the documentation
Hello @khalwat any news on that? We got some self-hosted video assets and it seems this is the only plugin available. Also is there a roadmap?
@gaelpleeroy I have not done any work on implementing a GraphQL API for the Transcoder plugin. You're the second person who has requested such a feature, though, which adds to its likelihood of being implemented
hi @khalwat , any plans to get this feature implemented in the near future?
It's on the list, but not immediately unfortunately.
I'd really like to see GraphQL support as well.