-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
379 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Backend\Channel\Modal; | ||
|
||
use App\Models\Channel\Video; | ||
use Livewire\Component; | ||
use LivewireUI\Modal\ModalComponent; | ||
|
||
class ViewVideo extends ModalComponent | ||
{ | ||
public $video_id; | ||
public $video; | ||
|
||
public static function closeModalOnClickAway(): bool | ||
{ | ||
return false; | ||
} | ||
|
||
public function mount() | ||
{ | ||
$this->video = Video::find($this->video_id); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.backend.channel.modal.view-video'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Backend\Settings; | ||
|
||
use Livewire\Component; | ||
|
||
class FilesystemSettings extends Component | ||
{ | ||
public $aws_access_key_id; | ||
public $aws_secret_access_key; | ||
public $aws_default_region; | ||
public $aws_bucket; | ||
public $aws_url; | ||
public $aws_endpoint; | ||
|
||
public $success; | ||
|
||
protected $listeners = ['settingsUpdated' => '$refresh']; | ||
|
||
public function mount() | ||
{ | ||
$this->aws_access_key_id = setting('aws_access_key_id'); | ||
$this->aws_secret_access_key = setting('aws_secret_access_key'); | ||
$this->aws_default_region = setting('aws_default_region'); | ||
$this->aws_bucket = setting('aws_bucket'); | ||
$this->aws_url = setting('aws_url'); | ||
$this->aws_endpoint = setting('aws_endpoint'); | ||
} | ||
|
||
public function submit() | ||
{ | ||
$validated = $this->validate([ | ||
'aws_access_key_id' => 'required', | ||
'aws_secret_access_key' => 'required', | ||
'aws_default_region' => 'required', | ||
'aws_bucket' => 'required', | ||
'aws_url' => 'required', | ||
'aws_endpoint' => 'required', | ||
]); | ||
foreach ($validated as $key => $value) | ||
{ | ||
setting()->set($key, $value); | ||
} | ||
|
||
$this->success = __('Filesystem Settings Updated'); | ||
$this->emit('settingsUpdated'); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.backend.settings.filesystem-settings'); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
app/Http/Livewire/Backend/Settings/TranscodingSettings.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace App\Http\Livewire\Backend\Settings; | ||
|
||
use Livewire\Component; | ||
|
||
class TranscodingSettings extends Component | ||
{ | ||
public $converted_file_driver; | ||
public $hls_segment_size; | ||
public $frame_from_seconds; | ||
|
||
public $success; | ||
|
||
protected $listeners = ['settingsUpdated' => '$refresh']; | ||
|
||
public function mount() | ||
{ | ||
$this->converted_file_driver = setting('converted_file_driver', config('site.converted_file_driver')); | ||
$this->hls_segment_size = setting('hls_segment_size', config('site.hls_segment_size')); | ||
$this->frame_from_seconds = setting('frame_from_seconds', config('site.frame_from_seconds')); | ||
} | ||
|
||
public function submit() | ||
{ | ||
$validated = $this->validate([ | ||
'converted_file_driver' => 'required', | ||
'hls_segment_size' => 'required', | ||
'frame_from_seconds' => 'required', | ||
]); | ||
foreach ($validated as $key => $value) | ||
{ | ||
setting()->set($key, $value); | ||
} | ||
|
||
$this->success = __('Transcoding Settings Updated'); | ||
$this->emit('settingsUpdated'); | ||
} | ||
|
||
public function render() | ||
{ | ||
return view('livewire.backend.settings.transcoding-settings'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
resources/views/livewire/backend/channel/modal/view-video.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<x-modal> | ||
<x-slot name="title"> | ||
<h3 class="text-lg font-medium text-gray-900">{{ __('Video Details') }}</h3> | ||
</x-slot> | ||
<x-slot name="content"> | ||
<div class="p-3"> | ||
<div id="player"></div> | ||
</div> | ||
<div class="w-full p-3"> | ||
<h2 class="text-md font-bold leading-5 text-gray-900 sm:text-3xl sm:truncate">{{ $video->name }}</h2> | ||
<p class="mt-2">{{ $video->description }}</p> | ||
</div> | ||
<div class="w-full p-3 flex justify-between items-center"> | ||
<h2 class="font-medium">{{ __('Video Link') }}</h2> | ||
<a id="video_link mt-1" href="{{ route('watch', ['v' => $video->media_id]) }}" class="text-indigo-500" target="_blank">{{ route('watch', ['v' => $video->media_id]) }}</a> | ||
</div> | ||
</x-slot> | ||
</x-modal> | ||
|
||
<script> | ||
function renderVideoPlayer() { | ||
let playerElement = document.getElementById("player"); | ||
let aspectRatio = 9/16, newWidth = playerElement.parentElement.offsetWidth, newHeight = 2 * Math.round(newWidth * aspectRatio/2); | ||
let player = new Clappr.Player({ | ||
source: '{{ \Illuminate\Support\Facades\Storage::disk($video->disk)->url($video->streaming_url) }}', | ||
plugins: [HlsjsPlayback], | ||
poster: '{{ \Illuminate\Support\Facades\Storage::disk($video->disk)->url($video->thumbnail_url) }}' | ||
}); | ||
player.attachTo(playerElement); | ||
} | ||
renderVideoPlayer(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.