Biete das Vollbild für Vorschauclips je Widget an (ADR-43)
Neue Einstellung "fullscreen" (Vorgabe: nicht anbieten) an den Kartenwidgets und an Bild und Text. Die Schaltfläche erscheint nur mit freigegebenem Clip und wenn das Gerät Vollbild kann. Im Vollbild gibt es Ton und native Bedienung, Scrollen und Zeiger stoppen den Clip nicht; beim Verlassen kehrt die Karte zum Kartenbild zurück. Gemeinsames Modul resources/js/player/fullscreen.js. iPhone-Weg bisher nur als Logik, Gerätetest steht aus. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fd5db90b77
commit
adaa68948a
11 files changed
+382
-7
No files matched your search
@@ -206,6 +206,54 @@ public function test_the_editor_can_switch_the_trailer_off_per_card_and_the_choi
|
||||
}
|
||||
}
|
||||
|
||||
public function test_fullscreen_is_off_by_default_and_offered_per_card_only_with_a_released_clip(): void
|
||||
{
|
||||
$film = $this->publicFilm();
|
||||
$trailer = $this->clip('Trailer Denkpause');
|
||||
$this->assign($film, 'trailer', $trailer);
|
||||
$this->release($trailer);
|
||||
|
||||
$this->publish('/trailer-vollbild', [[
|
||||
'layout' => 'u1_1_1_1',
|
||||
'style' => [],
|
||||
'slots' => [
|
||||
$this->mediaCard($film)['slots'][0],
|
||||
$this->mediaCard($film, [], ['fullscreen' => 'no'])['slots'][0],
|
||||
$this->mediaCard($film, [], ['fullscreen' => 'yes'])['slots'][0],
|
||||
$this->mediaCard($film, [], ['clip' => 'no', 'fullscreen' => 'yes'])['slots'][0],
|
||||
],
|
||||
]]);
|
||||
|
||||
$cards = $this->cards($this->get('/trailer-vollbild')->assertOk()->getContent());
|
||||
$this->assertCount(4, $cards);
|
||||
$this->assertStringNotContainsString('data-clip-fullscreen', $cards[0], 'Vorgabe: kein Vollbild, auch für gespeicherte Karten ohne Wahl.');
|
||||
$this->assertStringNotContainsString('data-clip-fullscreen', $cards[1]);
|
||||
$this->assertStringContainsString('data-clip-fullscreen', $cards[2]);
|
||||
$this->assertStringContainsString('aria-label="Vollbild: ', $cards[2]);
|
||||
$this->assertMatchesRegularExpression('/<button[^>]*class="lf-pc__clip-fullscreen"[^>]*\shidden[\s>]/', $cards[2], 'Ohne JavaScript bleibt die Schaltfläche verborgen.');
|
||||
$this->assertStringNotContainsString('data-card-clip', $cards[3]);
|
||||
$this->assertStringNotContainsString('data-clip-fullscreen', $cards[3], 'Ohne Trailer gibt es kein Vollbild.');
|
||||
$this->assertStringNotContainsString('originals/', $cards[2]);
|
||||
}
|
||||
|
||||
public function test_the_fullscreen_choice_exists_where_the_trailer_choice_exists_and_is_validated(): void
|
||||
{
|
||||
$registry = app(WidgetRegistry::class);
|
||||
$this->assertSame(['no', 'yes'], array_keys($registry->get('media_card')->settingOptions()['fullscreen']));
|
||||
$this->assertSame(['no', 'yes'], array_keys($registry->get('program_card')->settingOptions()['fullscreen']));
|
||||
$this->assertArrayNotHasKey('fullscreen', $registry->get('topic_card')->settingOptions(), 'Ein Thema hat keinen Trailer.');
|
||||
$this->assertContains('fullscreen', $registry->get('media_card')->settingGroups()['Bild und Video']);
|
||||
|
||||
$film = $this->publicFilm();
|
||||
|
||||
try {
|
||||
$registry->normalize([['type' => 'media_card', 'v' => 1, 'variant' => 'adaptive', 'settings' => ['fullscreen' => 'immer'], 'data' => [], 'refs' => ['element' => $film->id]]]);
|
||||
$this->fail('Eine unbekannte Vollbild-Wahl wurde angenommen.');
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayHasKey('blocks.0.settings.fullscreen', $exception->errors());
|
||||
}
|
||||
}
|
||||
|
||||
public function test_the_program_card_plays_the_trailer_of_the_program(): void
|
||||
{
|
||||
$program = $this->program('Programm Mut');
|
||||
|
||||
@@ -130,6 +130,36 @@ public function test_the_released_trailer_plays_on_the_image_on_hover_and_click(
|
||||
$this->assertStringNotContainsString('originals/', $html);
|
||||
}
|
||||
|
||||
public function test_fullscreen_for_the_video_is_off_by_default_and_a_per_widget_choice(): void
|
||||
{
|
||||
$film = $this->clip('Teaser Pause');
|
||||
$image = $this->image('Foto Pause');
|
||||
$this->release($film);
|
||||
$this->release($image);
|
||||
$refs = ['image' => $image->id, 'video' => $film->id];
|
||||
|
||||
$default = $this->publish('/bild-video-vollbild-aus', $this->widget(['body' => '<p>Text</p>'], $refs));
|
||||
$on = $this->publish('/bild-video-vollbild', $this->widget(['body' => '<p>Text</p>'], $refs, ['fullscreen' => 'yes']));
|
||||
$withoutVideo = $this->publish('/bild-ohne-video-vollbild', $this->widget(['body' => '<p>Text</p>'], ['image' => $image->id], ['fullscreen' => 'yes']));
|
||||
|
||||
$this->assertStringContainsString('data-card-clip', $default);
|
||||
$this->assertStringNotContainsString('data-clip-fullscreen', $default, 'Vorgabe: kein Vollbild, auch für gespeicherte Widgets ohne Wahl.');
|
||||
$this->assertStringContainsString('data-clip-fullscreen', $on);
|
||||
$this->assertStringContainsString('aria-label="Vollbild: Teaser Pause"', $on);
|
||||
$this->assertStringNotContainsString('data-clip-fullscreen', $withoutVideo, 'Ohne freigegebenes Video gibt es kein Vollbild.');
|
||||
|
||||
$registry = app(WidgetRegistry::class);
|
||||
$this->assertSame(['no', 'yes'], array_keys($registry->get('image_text')->settingOptions()['fullscreen']));
|
||||
$this->assertContains('fullscreen', $registry->get('image_text')->settingGroups()['Bild und Video']);
|
||||
|
||||
try {
|
||||
$registry->normalize($this->widget(['body' => '<p>Text</p>'], $refs, ['fullscreen' => 'immer'])[0]['slots']);
|
||||
$this->fail('Eine unbekannte Vollbild-Wahl wurde angenommen.');
|
||||
} catch (ValidationException $exception) {
|
||||
$this->assertArrayHasKey('blocks.0.settings.fullscreen', $exception->errors());
|
||||
}
|
||||
}
|
||||
|
||||
public function test_an_image_with_a_video_can_also_stand_without_text(): void
|
||||
{
|
||||
$film = $this->clip('Teaser Pause');
|
||||
|
||||
Reference in new issue
Block a user