|
12 | 12 | * limitations under the License. |
13 | 13 | **/ |
14 | 14 |
|
| 15 | +use App\Jobs\CreateMUXPlaybackRestrictionForSummit; |
15 | 16 | use App\Models\Foundation\Main\IGroup; |
16 | 17 | use App\Models\Foundation\Main\OrderableChilds; |
17 | 18 | use App\Models\Foundation\Summit\EmailFlows\SummitEmailEventFlowType; |
|
34 | 35 | use DateTime; |
35 | 36 | use Doctrine\Common\Collections\ArrayCollection; |
36 | 37 | use Doctrine\Common\Collections\Criteria; |
| 38 | +use Illuminate\Support\Facades\Cache; |
37 | 39 | use Illuminate\Support\Facades\Config; |
38 | 40 | use Illuminate\Support\Facades\Log; |
39 | 41 | use models\exceptions\ValidationException; |
@@ -663,6 +665,18 @@ public function setMarketingSiteOauth2ClientScopes(string $marketing_site_oauth2 |
663 | 665 | */ |
664 | 666 | private $mux_private_key; |
665 | 667 |
|
| 668 | + /** |
| 669 | + * @ORM\Column(name="MUXPlaybackRestrictionId", type="string") |
| 670 | + * @var string |
| 671 | + */ |
| 672 | + private $mux_playback_restriction_id; |
| 673 | + |
| 674 | + /** |
| 675 | + * @ORM\Column(name="MUXAllowedDomains", type="string") |
| 676 | + * @var string |
| 677 | + */ |
| 678 | + private $mux_allowed_domains; |
| 679 | + |
666 | 680 | /** |
667 | 681 | * @ORM\OneToMany(targetEntity="models\summit\SummitEventType", mappedBy="summit", cascade={"persist","remove"}, orphanRemoval=true) |
668 | 682 | */ |
@@ -6489,7 +6503,6 @@ public function hasRelatedActivities(PresentationCategory $track): bool{ |
6489 | 6503 | public function getQRCodesEncKey():?string { |
6490 | 6504 | return $this->qr_codes_enc_key; |
6491 | 6505 | } |
6492 | | - |
6493 | 6506 | public function hasQRCodesEncKey():bool{ |
6494 | 6507 | return !empty($this->qr_codes_enc_key); |
6495 | 6508 | } |
@@ -6573,4 +6586,58 @@ public function hasMuxPrivateKey():bool{ |
6573 | 6586 | return !empty($this->mux_private_key); |
6574 | 6587 | } |
6575 | 6588 |
|
| 6589 | + /** |
| 6590 | + * @return string |
| 6591 | + */ |
| 6592 | + public function getMuxPlaybackRestrictionId(): ?string |
| 6593 | + { |
| 6594 | + return $this->mux_playback_restriction_id; |
| 6595 | + } |
| 6596 | + |
| 6597 | + /** |
| 6598 | + * @param string $mux_playback_restriction_id |
| 6599 | + */ |
| 6600 | + public function setMuxPlaybackRestrictionId(string $mux_playback_restriction_id): void |
| 6601 | + { |
| 6602 | + $this->mux_playback_restriction_id = $mux_playback_restriction_id; |
| 6603 | + |
| 6604 | + Cache::tags(sprintf('secure_streams_%s', $this->id))->flush(); |
| 6605 | + } |
| 6606 | + |
| 6607 | + public function clearMuxPlaybackRestrictionId(): void |
| 6608 | + { |
| 6609 | + $this->mux_playback_restriction_id = null; |
| 6610 | + |
| 6611 | + Cache::tags(sprintf('secure_streams_%s', $this->id))->flush(); |
| 6612 | + } |
| 6613 | + |
| 6614 | + /** |
| 6615 | + * @return string |
| 6616 | + */ |
| 6617 | + public function getMuxAllowedDomains(): array |
| 6618 | + { |
| 6619 | + if(empty($this->mux_allowed_domains)) return []; |
| 6620 | + return explode('|', $this->mux_allowed_domains); |
| 6621 | + } |
| 6622 | + |
| 6623 | + /** |
| 6624 | + * @param array $mux_allowed_domains |
| 6625 | + */ |
| 6626 | + public function setMuxAllowedDomains(array $mux_allowed_domains): void |
| 6627 | + { |
| 6628 | + Log::debug |
| 6629 | + ( |
| 6630 | + sprintf |
| 6631 | + ( |
| 6632 | + "Summit::setMuxAllowedDomains summit %s mux_allowed_domains %s", |
| 6633 | + $this->getId(), |
| 6634 | + json_encode($mux_allowed_domains) |
| 6635 | + ) |
| 6636 | + ); |
| 6637 | + |
| 6638 | + $this->mux_allowed_domains = implode('|', $mux_allowed_domains); |
| 6639 | + if(!empty($this->mux_token_id) && !empty($this->mux_token_secret)) |
| 6640 | + CreateMUXPlaybackRestrictionForSummit::dispatch($this->id); |
| 6641 | + } |
| 6642 | + |
6576 | 6643 | } |
0 commit comments