|
10 | 10 |
|
11 | 11 | namespace nystudio107\transcoder; |
12 | 12 |
|
| 13 | +use nystudio107\transcoder\assetbundles\transcoder\TranscoderAsset; |
13 | 14 | use nystudio107\transcoder\services\Transcode; |
14 | 15 | use nystudio107\transcoder\variables\TranscoderVariable; |
15 | 16 | use nystudio107\transcoder\models\Settings; |
16 | 17 |
|
| 18 | +use nystudio107\pluginmanifest\services\ManifestService; |
| 19 | + |
17 | 20 | use Craft; |
18 | 21 | use craft\base\Plugin; |
19 | 22 | use craft\console\Application as ConsoleApplication; |
|
41 | 44 | * @package Transcode |
42 | 45 | * @since 1.0.0 |
43 | 46 | * |
44 | | - * @property Transcode $transcode |
45 | | - * @property Settings $settings |
| 47 | + * @property Transcode $transcode |
| 48 | + * @property Settings $settings |
| 49 | + * @property ManifestService $manifest |
46 | 50 | * @method Settings getSettings() |
47 | 51 | */ |
48 | 52 | class Transcoder extends Plugin |
@@ -133,14 +137,25 @@ protected function createSettingsModel() |
133 | 137 | */ |
134 | 138 | protected function addComponents() |
135 | 139 | { |
| 140 | + // Register the manifest service |
| 141 | + $this->set('manifest', [ |
| 142 | + 'class' => ManifestService::class, |
| 143 | + 'assetClass' => TranscoderAsset::class, |
| 144 | + 'devServerManifestPath' => 'http://transcoder-buildchain:8080/', |
| 145 | + 'devServerPublicPath' => 'http://transcoder-buildchain:8080/', |
| 146 | + ]); |
| 147 | + |
136 | 148 | // Register our variables |
137 | 149 | Event::on( |
138 | 150 | CraftVariable::class, |
139 | 151 | CraftVariable::EVENT_INIT, |
140 | 152 | function (Event $event) { |
141 | 153 | /** @var CraftVariable $variable */ |
142 | 154 | $variable = $event->sender; |
143 | | - $variable->set('transcoder', TranscoderVariable::class); |
| 155 | + $variable->set('transcoder', [ |
| 156 | + 'class' => TranscoderVariable::class, |
| 157 | + 'manifestService' => $this->manifest, |
| 158 | + ]); |
144 | 159 | } |
145 | 160 | ); |
146 | 161 | } |
|
0 commit comments