nystudio107 / craft-transcoder

Transcode video & audio files to various formats, and provide video thumbnails
https://nystudio107.com/plugins/transcoder
Other
43 stars 12 forks source link

How to access transcoder on API level #8

Closed arifje closed 5 years ago

arifje commented 5 years ago

Not a bug, but more a request for example; I want to access the Transcoder methods from another plugin (Elements API) and I don't know how.

I tried to access services:

$transcoderService = \nystudio107\transcoder\Transcoder::$plugin->getInstance();
$transcoderService->Transcode->getVideoUrl();

But no luck.

Thanks in advance!

khalwat commented 5 years ago

You'd do something like this:

use nystudio107\transcoder\Transcoder;

$url = Transcoder::$plugin->transcode->getVideoUrl($filePath, $videoOptions);