Skip to content

Commit

Permalink
fix: rate limiter upload + add playsinline video for autoplay
Browse files Browse the repository at this point in the history
  • Loading branch information
abourtnik committed Dec 11, 2023
1 parent d74a9b7 commit c948a4b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function configureRateLimiting() : void
});

RateLimiter::for('upload', function (Request $request) {
return Limit::perMinute(100)->by($request->user()->id . $request->get('resumableIdentifier'))
return Limit::perMinute(130)->by($request->user()->id . $request->get('resumableIdentifier'))
->response(fn(Request $request, array $headers) => $this->response($request, $headers));
});
}
Expand Down
1 change: 1 addition & 0 deletions resources/views/users/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class="rounded-2"
poster="{{$user->pinned_video->thumbnail_url}}"
oncontextmenu="return false;"
autoplay
playsinline
>
<source src="{{$user->pinned_video->file_url}}" type="{{$user->pinned_video->mimetype}}">
</video>
Expand Down
10 changes: 9 additions & 1 deletion resources/views/videos/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
</div>
</div>
@else
<video controls class="w-100 border border-1 rounded" controlsList="nodownload" poster="{{$video->thumbnail_url}}" oncontextmenu="return false;" autoplay>
<video
controls
class="w-100 border border-1 rounded"
controlsList="nodownload"
poster="{{$video->thumbnail_url}}"
oncontextmenu="return false;"
autoplay
playsinline
>
<source src="{{$video->file_url}}#t={{$t}}" type="{{$video->mimetype}}">
</video>
@endif
Expand Down

0 comments on commit c948a4b

Please sign in to comment.