craft-transcoder icon indicating copy to clipboard operation
craft-transcoder copied to clipboard

[FR] GraphQL Support

Open denisyilmaz opened this issue 4 years ago • 9 comments

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?

denisyilmaz avatar May 19 '20 13:05 denisyilmaz

For example something like url @transcode(…) would be great.

{
  asset(kind: "video") {
    title
    url @transcoder(width:768 ,videoBitRate:"500k")
  }
}

denisyilmaz avatar May 20 '20 08:05 denisyilmaz

@khalwat I guess this has no priority?

denisyilmaz avatar Jul 01 '20 08:07 denisyilmaz

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.

khalwat avatar Jul 01 '20 12:07 khalwat

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

denisyilmaz avatar Jul 02 '20 12:07 denisyilmaz

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 avatar Nov 23 '21 19:11 gaelpleeroy

@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

khalwat avatar Nov 23 '21 19:11 khalwat

hi @khalwat , any plans to get this feature implemented in the near future?

denisyilmaz avatar May 20 '22 08:05 denisyilmaz

It's on the list, but not immediately unfortunately.

khalwat avatar May 24 '22 15:05 khalwat

I'd really like to see GraphQL support as well.

benfeather avatar Nov 29 '23 01:11 benfeather