Hauptadresse statt Zweitadresse, Abspielgeschwindigkeit je Video
- Weitere Adressen einer Website (z. B. www.stommer.info) leiten per 301 auf die Hauptadresse um; vorher blockierte der Browser Skripte, Schriften und Videos, die von der Hauptadresse kamen (kein Titelvideo, Ersatzschrift) - Site::origin() nimmt verbindlich das Feld domain - Videos: Abspielgeschwindigkeit 0,5x bis 1x, gilt im Titelbereich und Rundgang Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b5ff837dcd
commit
cc47cac93e
14 files changed
+113
-16
No files matched your search
@@ -51,6 +51,15 @@ public static function configure(Schema $schema): Schema
|
||||
->default(fn (): ?int => app(CurrentProperty::class)->id())
|
||||
->placeholder('– keine (z. B. Umgebung) –')
|
||||
->live(),
|
||||
Select::make('playback_rate')
|
||||
->label('Abspielgeschwindigkeit')
|
||||
->helperText('Gilt überall, wo das Video gezeigt wird – im Titelbereich und im Rundgang. Drohnenflüge wirken mit 0,75× ruhiger; unter 0,6× kann die Bewegung ruckeln. Kapitelzeiten bleiben gleich.')
|
||||
->options(Video::PLAYBACK_RATES)
|
||||
->formatStateUsing(fn (mixed $state): string => self::rateKey($state))
|
||||
->dehydrateStateUsing(fn (mixed $state): float => (float) $state)
|
||||
->default('1')
|
||||
->selectablePlaceholder(false)
|
||||
->required(),
|
||||
Section::make('Kapitel')
|
||||
->description('Für den Rundgang: Besucher springen per Knopf zu einem Raum. Ist ein Raum aus dem Grundriss gewählt, bietet der Grundriss bei diesem Raum „Im Video ansehen“ an.')
|
||||
->collapsible()
|
||||
@@ -87,6 +96,16 @@ public static function configure(Schema $schema): Schema
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Option key for a stored rate (0.75 → "0.75", 1.0 → "1"); unknown values fall back to the original speed.
|
||||
*/
|
||||
public static function rateKey(mixed $rate): string
|
||||
{
|
||||
$key = rtrim(rtrim(number_format((float) ($rate ?: 1), 2, '.', ''), '0'), '.');
|
||||
|
||||
return array_key_exists($key, Video::PLAYBACK_RATES) ? $key : '1';
|
||||
}
|
||||
|
||||
/**
|
||||
* Names of the visible floor plan rooms of the apartment (name => name).
|
||||
*
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
use App\Themes\Theme;
|
||||
use App\Themes\ThemeFactory;
|
||||
use Closure;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -44,11 +45,33 @@ public function handle(Request $request, Closure $next): Response
|
||||
$context->set($tenant);
|
||||
}
|
||||
|
||||
if ($redirect = $this->toMainAddress($request, $theme->site)) {
|
||||
return $redirect;
|
||||
}
|
||||
|
||||
$this->useSiteOrigin($theme->site);
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* A website answers on one main address. Visitors coming in through a further address (e.g. www.…) are
|
||||
* sent there permanently – otherwise the page would load its scripts, fonts and videos from the main
|
||||
* address, which the browser treats as another origin and blocks (no JavaScript, fallback fonts).
|
||||
* Only GET/HEAD: a form sent to the other address must not lose its input.
|
||||
*/
|
||||
private function toMainAddress(Request $request, Site $site): ?RedirectResponse
|
||||
{
|
||||
$origin = $site->exists ? $site->origin() : null;
|
||||
$mainHost = $origin === null ? null : parse_url($origin, PHP_URL_HOST);
|
||||
|
||||
if (! is_string($mainHost) || strcasecmp($mainHost, $request->getHost()) === 0 || ! $request->isMethodSafe()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return new RedirectResponse($origin.$request->getRequestUri(), 301);
|
||||
}
|
||||
|
||||
/**
|
||||
* Links must carry the address the visitor came in on. AppServiceProvider forces APP_URL for every
|
||||
* generated URL, because on Strato the document root is a release folder; with one landlord that was
|
||||
|
||||
+3
-2
@@ -54,11 +54,12 @@ public function domains(): HasMany
|
||||
}
|
||||
|
||||
/**
|
||||
* Scheme and host for guest links. Empty while the website has no hostname yet.
|
||||
* Scheme and main host for guest links (the domain field; further addresses redirect there, see
|
||||
* ResolveTheme). Empty while the website has no hostname yet.
|
||||
*/
|
||||
public function origin(): ?string
|
||||
{
|
||||
$host = $this->domains()->value('host') ?: $this->domain;
|
||||
$host = $this->domain ?: $this->domains()->orderBy('id')->value('host');
|
||||
|
||||
if (! is_string($host) || $host === '') {
|
||||
return null;
|
||||
|
||||
+13
-1
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* @property list<array{at?: string, label?: string, room?: string|null}>|null $chapters
|
||||
*/
|
||||
#[Fillable(['property_id', 'title', 'chapters'])]
|
||||
#[Fillable(['property_id', 'title', 'chapters', 'playback_rate'])]
|
||||
class Video extends Model implements HasMedia
|
||||
{
|
||||
/** @use HasFactory<VideoFactory> */
|
||||
@@ -29,6 +29,9 @@ class Video extends Model implements HasMedia
|
||||
|
||||
public const POSTER = 'poster';
|
||||
|
||||
/** Speeds offered in the admin (rate => label); the browser plays the file at this speed everywhere. */
|
||||
public const PLAYBACK_RATES = ['0.5' => 'Halb so schnell (0,5×)', '0.6' => 'Sehr ruhig (0,6×)', '0.75' => 'Ruhig (0,75×)', '0.85' => 'Etwas langsamer (0,85×)', '1' => 'Original (1×)'];
|
||||
|
||||
/** Largest accepted video file in KB (Strato allows uploads up to 128 MB). */
|
||||
public const MAX_KB = 100 * 1024;
|
||||
|
||||
@@ -41,6 +44,7 @@ protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'chapters' => 'array',
|
||||
'playback_rate' => 'float',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -79,6 +83,14 @@ public function url(): ?string
|
||||
return $this->getFirstMediaUrl(self::COLLECTION) ?: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Playback speed for the browser, limited to 0.25–2; chapter times stay in video time.
|
||||
*/
|
||||
public function playbackRate(): float
|
||||
{
|
||||
return min(2.0, max(0.25, (float) ($this->playback_rate ?: 1)));
|
||||
}
|
||||
|
||||
public function mimeType(): string
|
||||
{
|
||||
return $this->getFirstMedia(self::COLLECTION)?->mime_type ?? 'video/mp4';
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Playback speed per video (e.g. 0.75 for a calmer drone flight), used wherever the video appears.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->decimal('playback_rate', 3, 2)->default(1)->after('chapters');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropColumn('playback_rate');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -1,5 +1,7 @@
|
||||
# Projektstand
|
||||
|
||||
**Hauptadresse und Abspielgeschwindigkeit (30.10.2026):** Weitere Adressen einer Website (z. B. www.stommer.info) leiten jetzt dauerhaft (301, nur GET/HEAD) auf die Hauptadresse (`Site.domain`) um (`ResolveTheme::toMainAddress`). Vorher lud die Seite unter www Skripte, Schriften und Videos von der Adresse ohne www – der Browser blockierte sie als fremde Herkunft: kein JavaScript (Titelvideo, Menü-Pfeile), Ersatzschrift. `Site::origin()` nimmt verbindlich das Feld `domain`. Videos haben eine **Abspielgeschwindigkeit** (Webseite › Videos, 0,5×–1×), die überall gilt, wo das Video läuft.
|
||||
|
||||
**Titelvideo, Rundgang, freie Termine, Buchungsseite (30.10.2026, Branch `feature/titelvideo-rundgang`):** Neue Verwaltung **Webseite › Videos** (`Video`: Datei bis 100 MB, Standbild, Kapitel mit Raum aus dem Grundriss; Upload-Grenzen von Livewire/Medienbibliothek auf 100 MB angehoben – vorher scheiterten schon Fotos über 10 MB). **Titelbereich:** „Video statt Foto“ (stumme Schleife, lädt nur ohne „Bewegung reduzieren“/Save-Data, Pause-Knopf) und „Nächste freie Termine“ (`App\Availability\NextFreeStays`: bis zu 3 buchbare, nicht überlappende Zeiträume mit Gesamtpreis, 10 Min. zwischengespeichert, Klick füllt die Anfrage vor; Seebad: Fahrkarten). **Neuer Baustein „Rundgang (Video)“** (Anordnung wählbar: volle Breite/Video links/rechts; Kapitel als Fahrplan; lädt erst beim Start); Grundriss-Räume mit Kapitel bieten „Im Rundgang ansehen“. **Buchungsseite:** Preis links unter dem Kalender, Formular rechts (auf großen Bildschirmen mitlaufend) – keine halbleere Seite mehr; Ablauf „Anfrage → Angebot → Annahme“ als Grafik (abschaltbar). **Seebad:** Sonnenaufgang des Trenners einmal beim Hinscrollen statt unmerklicher Dauerbewegung. Aus dem Agenturvideo (41,7 MB, Rechte bei Stommers) geschnitten: Titelschleife „Garten und Meer“ (9 s, 3,5 MB) und Rundgang (58 s, 14,5 MB) – liegen nicht im Repo, Upload über den Admin. Lokal mit Bildschirmfotos (Desktop/Handy) geprüft. Tests: **526 Feature-Tests grün**, Pint, `themes:check` beide Themes.
|
||||
|
||||
**Erinnerungen und Zusammenfassungen einstellbar (30.10.2026, Branch `feature/erinnerungen-zusammenfassung`):** Neuer Abschnitt System › Betrieb › **Benachrichtigungen** (Spalten auf `tenants`). „Offene Meldungen erneut senden“: nur einmal (Vorgabe), täglich, alle 2/3 Tage, wöchentlich – gilt für mögliche Doppelbuchungen (solange im Postfach ungelesen und weiter festgestellt; Lesen beendet die Erinnerung, `Inbox::reminderDue`) und offene Portal-Aufgaben (`RemindChannelTasks`). **Tägliche und/oder wöchentliche Zusammenfassung** (`SendDigests`, Scheduler alle 15 Minuten, ab wählbarer Uhrzeit, Wochentag wählbar; am Wochentag nur die Wochenübersicht) mit wählbaren Teilen (`DigestSection`, `DigestReport`): Postfach, offene Anfragen/Angebote mit Frist, Neues seit der letzten Übersicht (Anfragen, Buchungen, Stornierungen, Portalbuchungen), An-/Abreisen (heute+morgen bzw. 7 Tage), überfällige Zahlungen, Portal-Aufgaben/zu prüfende Portal-Mails/Kalender-Klärungsfälle/Abgleichsfehler, Bewertungen zur Freigabe. Leere Übersichten entfallen (abschaltbar), Knopf „Zusammenfassung jetzt senden“. Vorgabe: täglich 7 Uhr an, wöchentlich aus. Tests: **520 Feature-Tests / 2725 Assertions grün**, Pint. Seite nicht im Browser angesehen.
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ ## 5. Bausteinkatalog – Vertrag der Vorlagen
|
||||
|
||||
Rich-Text-Variablen sind bereits bereinigt (HtmlString) und werden mit `{{ $text }}` ausgegeben.
|
||||
|
||||
**Jeder platzierte Baustein** hat `data.id` (feste UUID, `Page::assignSectionIds` beim Speichern; Kopien bekommen eine neue) und `data.appearances` (Erscheinungsbild-IDs; leer = immer sichtbar, sonst nur in diesen – z. B. ein Weihnachts-Baustein). **Bilder in Bausteinen** (Basisklasse): `chosenPhotos()` = ausgewählte Fotos in ihrer Reihenfolge, nur veröffentlichte und zur Saison passende; `automaticPhotos()` = `Photo::automatic()` (Fotos der Wohnung des Bausteins und solche ohne Wohnung, nie Kategorie „Grundriss & Pläne“, zur Saison passend, Saisonfotos zuerst); `photoSourceFields()`/`sourcedPhotos()` = Wahl „automatisch“ oder „eigene Auswahl“ (`data.photo_source`, `data.photo_ids`). Titelbereich und Abschluss halten eine Liste `photo_ids`, gezeigt wird das erste passende Foto. Ein Foto gehört zu keinem (= ganzjährig) oder mehreren Erscheinungsbildern; dann erscheint es nur dort und vor den ganzjährigen. Alle Bildauswahlen nutzen `App\Filament\Forms\Components\PhotoSelect` (Vorschaubild + Beschreibung, nach Kategorie gruppiert). **Videos** (`App\Models\Video`, Admin › Webseite › Videos: Datei MP4/WebM bis 100 MB, Standbild, Kapitel „Min:Sek – Bezeichnung – Raum im Grundriss“) wählen Bausteine mit `videoSelect()` und holen sie mit `video()`. **Einmaliges Einblenden:** `data-reveal` an einem Element → theme.js setzt `ready` und beim Hinscrollen `shown`; das Theme gestaltet beide Zustände in `@media (prefers-reduced-motion: no-preference)` (Seebad: Sonnenaufgang des Trenners). Ohne JS oder mit „Bewegung reduzieren“ bleibt der Endzustand.
|
||||
**Jeder platzierte Baustein** hat `data.id` (feste UUID, `Page::assignSectionIds` beim Speichern; Kopien bekommen eine neue) und `data.appearances` (Erscheinungsbild-IDs; leer = immer sichtbar, sonst nur in diesen – z. B. ein Weihnachts-Baustein). **Bilder in Bausteinen** (Basisklasse): `chosenPhotos()` = ausgewählte Fotos in ihrer Reihenfolge, nur veröffentlichte und zur Saison passende; `automaticPhotos()` = `Photo::automatic()` (Fotos der Wohnung des Bausteins und solche ohne Wohnung, nie Kategorie „Grundriss & Pläne“, zur Saison passend, Saisonfotos zuerst); `photoSourceFields()`/`sourcedPhotos()` = Wahl „automatisch“ oder „eigene Auswahl“ (`data.photo_source`, `data.photo_ids`). Titelbereich und Abschluss halten eine Liste `photo_ids`, gezeigt wird das erste passende Foto. Ein Foto gehört zu keinem (= ganzjährig) oder mehreren Erscheinungsbildern; dann erscheint es nur dort und vor den ganzjährigen. Alle Bildauswahlen nutzen `App\Filament\Forms\Components\PhotoSelect` (Vorschaubild + Beschreibung, nach Kategorie gruppiert). **Videos** (`App\Models\Video`, Admin › Webseite › Videos: Datei MP4/WebM bis 100 MB, Standbild, Abspielgeschwindigkeit – Vorlagen setzen `data-playback-rate="{{ $video->playbackRate() }}"` am `<video>`, theme.js wendet sie an –, Kapitel „Min:Sek – Bezeichnung – Raum im Grundriss“) wählen Bausteine mit `videoSelect()` und holen sie mit `video()`. **Einmaliges Einblenden:** `data-reveal` an einem Element → theme.js setzt `ready` und beim Hinscrollen `shown`; das Theme gestaltet beide Zustände in `@media (prefers-reduced-motion: no-preference)` (Seebad: Sonnenaufgang des Trenners). Ohne JS oder mit „Bewegung reduzieren“ bleibt der Endzustand.
|
||||
|
||||
**Neuer Baustein** (auch als Plugin): Klasse `extends App\Themes\Sections\Section` (`key()`, `label()`, `icon()`, `schema()` = Admin-Felder, `data()` = Variablen) → in `config/themes.php › sections` eintragen → Vorlage `sections/<key>.blade.php` im Basis-Theme anlegen (Test `test_base_theme_is_discovered_and_provides_a_view_for_every_section` erzwingt das). Unbekannte Bausteine werden auf der Seite übersprungen, nie ein Fehler.
|
||||
|
||||
|
||||
@@ -71,6 +71,14 @@ document.querySelectorAll('[data-rotator]').forEach((rotator) => {
|
||||
|
||||
const reducedMotion = () => window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||
|
||||
// Playback speed set per video in the admin (data-playback-rate); also after the browser resets it on load.
|
||||
document.querySelectorAll('video[data-playback-rate]').forEach((video) => {
|
||||
const rate = Number(video.dataset.playbackRate) || 1;
|
||||
const apply = () => { video.defaultPlaybackRate = rate; video.playbackRate = rate; };
|
||||
apply();
|
||||
video.addEventListener('loadedmetadata', apply);
|
||||
});
|
||||
|
||||
// Silent video loops (partials/video-loop): loaded only with motion allowed and without Save-Data, playing while
|
||||
// visible; the button pauses and resumes. Otherwise the poster stays and nothing is downloaded.
|
||||
document.querySelectorAll('[data-video-loop]').forEach((box) => {
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
--}}
|
||||
<div class="relative {{ $wrapperClass ?? '' }}" data-video-loop>
|
||||
<video class="{{ $class ?? '' }}" muted loop playsinline disablepictureinpicture preload="none"
|
||||
poster="{{ $video->posterUrl() }}" data-src="{{ $video->url() }}" data-type="{{ $video->mimeType() }}"
|
||||
poster="{{ $video->posterUrl() }}" data-src="{{ $video->url() }}" data-type="{{ $video->mimeType() }}" data-playback-rate="{{ $video->playbackRate() }}"
|
||||
aria-label="Video: {{ $video->title }}"></video>
|
||||
<button type="button" data-video-toggle hidden aria-pressed="false" aria-label="Video anhalten" title="Video anhalten"
|
||||
class="{{ $buttonClass ?? 'absolute right-4 bottom-4' }} inline-flex size-12 items-center justify-center rounded-full bg-ink/70 text-ground backdrop-blur-sm hover:bg-ink focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ground">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8" aria-labelledby="{{ $sectionId }}-title" data-tour>
|
||||
<div @class(['grid items-center gap-10', 'lg:grid-cols-[3fr_2fr]' => $layout === 'left', 'lg:grid-cols-[2fr_3fr]' => $layout === 'right'])>
|
||||
<div @class(['relative overflow-hidden rounded bg-ink', 'lg:order-2' => $layout === 'right'])>
|
||||
<video class="aspect-video w-full" controls playsinline preload="none" poster="{{ $video->posterUrl() }}" aria-label="Video: {{ $video->title }}">
|
||||
<video class="aspect-video w-full" controls playsinline preload="none" poster="{{ $video->posterUrl() }}" data-playback-rate="{{ $video->playbackRate() }}" aria-label="Video: {{ $video->title }}">
|
||||
<source src="{{ $video->url() }}" type="{{ $video->mimeType() }}">
|
||||
</video>
|
||||
<button type="button" data-tour-start hidden class="absolute inset-0 flex items-center justify-center bg-ink/20 hover:bg-ink/30">
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<span class="absolute -top-0.5 -left-0.5 z-10" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-10'])</span>
|
||||
<span class="absolute -top-0.5 -right-0.5 z-10 -scale-x-100" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-10'])</span>
|
||||
<div class="relative bg-ink">
|
||||
<video class="block aspect-video w-full" controls playsinline preload="none" poster="{{ $video->posterUrl() }}" aria-label="Video: {{ $video->title }}">
|
||||
<video class="block aspect-video w-full" controls playsinline preload="none" poster="{{ $video->posterUrl() }}" data-playback-rate="{{ $video->playbackRate() }}" aria-label="Video: {{ $video->title }}">
|
||||
<source src="{{ $video->url() }}" type="{{ $video->mimeType() }}">
|
||||
</video>
|
||||
<button type="button" data-tour-start hidden class="group absolute inset-0 flex flex-col items-center justify-center gap-4 bg-ink/25 text-ground transition hover:bg-ink/35">
|
||||
|
||||
@@ -56,7 +56,7 @@ public function test_a_landlord_created_by_the_operator_is_reachable_at_once():
|
||||
);
|
||||
|
||||
$this->get('http://duene.test/')->assertOk()->assertSee('Ferienhaus Düne');
|
||||
$this->get('http://www.duene.test/')->assertOk();
|
||||
$this->get('http://www.duene.test/')->assertRedirect('https://duene.test/');
|
||||
}
|
||||
|
||||
public function test_a_suspended_landlord_shows_a_notice_instead_of_a_dead_link(): void
|
||||
@@ -88,8 +88,9 @@ public function test_the_default_notice_applies_when_none_was_written(): void
|
||||
|
||||
/**
|
||||
* Links carry the main address of the website they belong to – not APP_URL, which is a single value and
|
||||
* would have sent every visitor of a second landlord to the first landlord's host. Visiting through a
|
||||
* further address of the same website still yields the main address, which keeps one canonical host.
|
||||
* would have sent every visitor of a second landlord to the first landlord's host. A further address of the
|
||||
* same website redirects to the main address: one canonical host, and scripts, fonts and videos load from
|
||||
* the same origin as the page (a different origin is blocked by the browser).
|
||||
*/
|
||||
public function test_links_carry_the_main_address_of_their_own_website(): void
|
||||
{
|
||||
@@ -108,9 +109,8 @@ public function test_links_carry_the_main_address_of_their_own_website(): void
|
||||
// A further address of the same website keeps pointing at its main address.
|
||||
SiteDomain::query()->create(['site_id' => Site::withoutGlobalScope('tenant')->where('tenant_id', $second->id)->value('id'), 'host' => 'www.zweiter.test']);
|
||||
|
||||
$viaWww = (string) $this->get('http://www.zweiter.test/')->assertOk()->getContent();
|
||||
|
||||
$this->assertStringContainsString('https://zweiter.test', $viaWww);
|
||||
$this->get('http://www.zweiter.test/wohnung?x=1')->assertRedirect('https://zweiter.test/wohnung?x=1')->assertStatus(301);
|
||||
$this->post('http://www.zweiter.test/wohnung')->assertStatus(405);
|
||||
}
|
||||
|
||||
public function test_the_operator_adds_an_address_to_an_existing_landlord(): void
|
||||
@@ -132,7 +132,7 @@ public function test_the_operator_adds_an_address_to_an_existing_landlord(): voi
|
||||
->call('save')
|
||||
->assertHasNoErrors();
|
||||
|
||||
$this->get('http://neu.duene.test/')->assertOk();
|
||||
$this->get('http://neu.duene.test/')->assertRedirect('https://duene.test/');
|
||||
$this->get('http://duene.test/')->assertOk();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ public function test_chapters_are_read_as_minutes_and_seconds_sorted_and_matched
|
||||
public function test_hero_plays_a_silent_loop_instead_of_the_photo_and_shows_the_next_free_dates(): void
|
||||
{
|
||||
$loop = $this->videoWithFiles('Garten und Meer');
|
||||
$loop->update(['playback_rate' => 0.75]);
|
||||
Booking::factory()->for($this->property)->create(['arrival' => '2026-10-23', 'departure' => '2026-10-27', 'status' => BookingStatus::Confirmed]);
|
||||
$this->updateSection('start', 'hero', ['video_id' => $loop->id, 'show_free_dates' => true, 'free_dates_nights' => 3]);
|
||||
|
||||
@@ -76,6 +77,7 @@ public function test_hero_plays_a_silent_loop_instead_of_the_photo_and_shows_the
|
||||
->assertSee('data-video-loop', false)
|
||||
->assertSee('data-src="'.$loop->url().'"', false)
|
||||
->assertSee('aria-label="Video: Garten und Meer"', false)
|
||||
->assertSee('data-playback-rate="0.75"', false)
|
||||
->assertSee('Nächste freie Termine')
|
||||
->assertSee(e($stays[0]['url']), false);
|
||||
}
|
||||
@@ -133,14 +135,18 @@ public function test_content_editor_uploads_a_video_with_poster_and_chapters():
|
||||
'file' => UploadedFile::fake()->createWithContent('rundgang.mp4', (string) file_get_contents(base_path('tests/Fixtures/video.mp4'))),
|
||||
'poster' => UploadedFile::fake()->image('standbild.jpg', 1280, 720),
|
||||
'chapters' => [['at' => '0:07', 'label' => 'Garten', 'room' => null]],
|
||||
'playback_rate' => '0.75',
|
||||
])
|
||||
->call('save')
|
||||
->assertHasNoFormErrors();
|
||||
|
||||
Livewire::test(EditVideo::class, ['record' => $video->id])->assertSchemaStateSet(['playback_rate' => '0.75']);
|
||||
|
||||
$video->refresh();
|
||||
$this->assertNotNull($video->url());
|
||||
$this->assertNotNull($video->posterUrl());
|
||||
$this->assertSame(7, $video->chapterList()[0]['seconds']);
|
||||
$this->assertSame(0.75, $video->playbackRate());
|
||||
}
|
||||
|
||||
public function test_uploads_allow_videos_up_to_100_mb(): void
|
||||
|
||||
@@ -60,8 +60,9 @@ public function test_a_website_answers_on_every_address_entered_for_it(): void
|
||||
$this->editHosts($site, ['www.nordhaus.test', 'https://ALT.nordhaus.test/'])->assertHasNoFormErrors();
|
||||
|
||||
$this->get('http://nordhaus.test/')->assertOk()->assertSee('Nordhaus');
|
||||
$this->get('http://www.nordhaus.test/')->assertOk()->assertSee('Nordhaus');
|
||||
$this->get('http://alt.nordhaus.test/')->assertOk()->assertSee('Nordhaus');
|
||||
// Further addresses answer with a permanent redirect to the main address (one origin for page and assets).
|
||||
$this->get('http://www.nordhaus.test/')->assertRedirect('https://nordhaus.test/');
|
||||
$this->get('http://alt.nordhaus.test/')->assertRedirect('https://nordhaus.test/');
|
||||
$this->get('http://unbekannt.test/')->assertNotFound();
|
||||
|
||||
$this->assertSame(
|
||||
|
||||
Reference in new issue
Block a user