• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In
Build has been canceled!

nette / assets / 22312221661

23 Feb 2026 03:14PM UTC coverage: 94.106% (+0.06%) from 94.048%
22312221661

push

github

dg
added CLAUDE.md

495 of 526 relevant lines covered (94.11%)

0.94 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.44
/src/Assets/VideoAsset.php
1
<?php declare(strict_types=1);
1✔
2

3
namespace Nette\Assets;
4

5
use Nette\Utils\Html;
6

7

8
/**
9
 * Video asset.
10
 */
11
class VideoAsset implements Asset, HtmlRenderable
12
{
13
        public function __construct(
1✔
14
                public readonly string $url,
15
                public readonly ?string $file = null,
16
                public readonly ?int $width = null,
17
                public readonly ?int $height = null,
18
                public readonly ?string $mimeType = null,
19
                /** Duration in seconds */
20
                public readonly ?float $duration = null,
21
                /** Poster image URL */
22
                public readonly ?string $poster = null,
23
                public readonly bool $autoPlay = false,
24
        ) {
25
        }
1✔
26

27

28
        public function __toString(): string
29
        {
30
                return $this->url;
×
31
        }
32

33

34
        public function getImportElement(): Html
35
        {
36
                return Html::el('video', array_filter([
1✔
37
                        'src' => $this->url,
1✔
38
                        'width' => $this->width ? (string) $this->width : null,
1✔
39
                        'height' => $this->height ? (string) $this->height : null,
1✔
40
                        'type' => $this->mimeType,
1✔
41
                        'poster' => $this->poster,
1✔
42
                        'autoplay' => $this->autoPlay ? true : null,
1✔
43
                ], fn($value) => $value !== null));
1✔
44
        }
45

46

47
        public function getPreloadElement(): Html
48
        {
49
                return Html::el('link', array_filter([
1✔
50
                        'rel' => 'preload',
1✔
51
                        'href' => $this->url,
1✔
52
                        'as' => 'video',
1✔
53
                        'type' => $this->mimeType,
1✔
54
                ], fn($value) => $value !== null));
1✔
55
        }
56
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc