Skip to content

Commit

Permalink
MuxMate 3.0 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikkel committed Aug 22, 2024
1 parent 6ec957f commit 92ea0e1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 78 deletions.
72 changes: 2 additions & 70 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,5 @@
# MuxMate Changelog

## 2.1.0 - 2024-04-06
### Changed
- Added new icon

## 2.0.1 - 2023-11-11
### Fixed
- Fixed an issue where signed URL placeholder tokens would expire when used in combination with template caching

## 2.0.0 - 2023-10-18
### Added
- Added support for signing URLs
- Added support for Mux' `max_resolution` param for the `Asset::getMuxStreamUrl()` and `Asset::getMuxVideo()` methods
- Added the `muxSigningKey` config setting for setting a signing key used in signing URLs
- Added the `defaultPolicy` config setting for setting the default playback policy ("signed" or "public"; public is the default)
- Added the `defaultMaxResolution` config setting for setting a default max resolution
- Added the `defaultMp4Quality` config setting for setting the default static rendition quality
- Added the `maxResolutionTier` config setting for setting the `max_resolution_tier` param when creating new Mux assets
- Added the `_muxmate/create` command for creating Mux assets from existing Craft assets in bulk
- Added the `_muxmate/create/playback-ids` command for creating new (or missing) Mux playback IDs for existing Mux assets in bulk
- Added the `Asset::getMuxVideoDuration()` method
- Added the `Asset::getStaticRenditions()` method
- Added the ability to query for assets based on Mux meta data as JSON queries, e.g. `entry.videos.mux({ status: 'ready' }).all()`
### Changed
- Removed the `muxPlaybackId` content table column

## 1.2.0 - 2023-07-01
### Added
- Added the ability to have MuxMate automatically lazyload the `<mux-video>` web component
- Added the ability to have MuxMate *not* load the `<mux-video>` web component JS library at all
- Added the `lazyloadMuxVideo` config setting
- Added the `scriptSrcNonce` config setting
### Changed
- The `muxVideoUrl` config setting now supports a `false` value, in which case MuxMate will not load the `<mux-video>` library
- The `Asset::getMuxVideo()` method no longer returns `null`, avoiding a PHP exception that would occur if using the `|attr()` filter directly on its output.
### Improved
- Improved video previews when assets are missing their Mux playback ID

## 1.1.3 - 2023-06-23
### Fixed
- Fixed dumb bug

## 1.1.2 - 2023-06-21
### Fixed
- Fixed an issue where not all params passed to `getMuxImageUrl()` would make it

## 1.1.1 - 2023-06-21
### Fixed
- Fixed a PHP exception due to a typing error

## 1.1.0 - 2023-06-21
### Added
- Added the `isMuxVideo()` and `isMuxVideoReady()` asset methods.

## 1.0.3 - 2023-06-21
### Fixed
- Fixed an issue where the `getMuxAspectRatio()` always returned `1`

## 1.0.2 - 2023-06-13
### Improved
- More emoji statuses in MuxMate field table attributes 🎉
### Changed
- MuxMate now requires PHP 8.1+
- MuxMate fields now only uses the Mux asset ID for the search index

## 1.0.1 - 2023-06-13
### Fixed
- Fixed some visual bugs in the MuxMate input field template

## 1.0.0 - 2023-06-13
## 3.0.0 - 2024-08-22
### Added
- Initial release
- Added support for Craft 5
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MuxMate 2.x
# MuxMate 3.x

Mux ado about streaming, mate!

Expand All @@ -10,7 +10,7 @@ MuxMate integrates [Mux](https://www.mux.com/) with Craft CMS.

## Requirements

This plugin requires Craft CMS 4.5.0 or later, and PHP 8.1 or later.
This plugin requires Craft CMS 5.2.0 or later, and PHP 8.2 or later.

## Disclaimer

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
"name": "vaersaagod/muxmate",
"description": "Mux ado about streaming, mate!",
"type": "craft-plugin",
"version": "2.1.0",
"version": "3.0.0",
"require": {
"php": ">=8.1",
"craftcms/cms": "^4.5.0",
"php": ">=8.2",
"craftcms/cms": "^5.2.0",
"firebase/php-jwt": "^6.9",
"muxinc/mux-php": "^3.0"
},
Expand Down
6 changes: 3 additions & 3 deletions src/fields/MuxMateField.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function valueType(): string
* @param ElementInterface $element
* @return string
*/
public function getTableAttributeHtml(mixed $value, ElementInterface $element): string
public function getPreviewHtml(mixed $value, ElementInterface $element): string
{
if (!$element instanceof Asset || $element->kind !== Asset::KIND_VIDEO) {
return '';
Expand Down Expand Up @@ -92,7 +92,7 @@ public function getSettingsHtml(): ?string
/**
* @inheritdoc
*/
public function getContentColumnType(): array|string
public static function dbType(): array|string
{
return [
'muxAssetId' => Schema::TYPE_STRING,
Expand All @@ -119,7 +119,7 @@ public function normalizeValue(mixed $value, ElementInterface $element = null):
]);
}

protected function inputHtml(mixed $value, ElementInterface $element = null): string
protected function inputHtml(mixed $value, ElementInterface $element = null, bool $inline): string
{
if (!$element instanceof Asset || $element->kind !== Asset::KIND_VIDEO) {
$warningTip = new Tip([
Expand Down

0 comments on commit 92ea0e1

Please sign in to comment.