File tree 3 files changed +17
-7
lines changed
Presenters/templates/components
3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ abstract function getThumbnailURL(): string;
14
14
15
15
abstract function getURL (): string ;
16
16
17
- abstract function getEmbed (): string ;
17
+ abstract function getEmbed (string $ w = " 600 " , string $ h = " 340 " ): string ;
18
18
}
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ function getURL(): string
13
13
return "https://youtu.be/ $ this ->id " ;
14
14
}
15
15
16
- function getEmbed (): string
16
+ function getEmbed (string $ w = " 600 " , string $ h = " 340 " ): string
17
17
{
18
18
return <<<CODE
19
19
<iframe
20
- width="600 "
21
- height="340 "
20
+ width=" $ w "
21
+ height=" $ h "
22
22
src="https://www.youtube-nocookie.com/embed/ $ this ->id "
23
23
frameborder="0"
24
24
sandbox="allow-same-origin allow-scripts allow-popups"
Original file line number Diff line number Diff line change 9
9
</a >
10
10
{/if}
11
11
{elseif $attachment instanceof \openvk\Web\Models\Entities\Video}
12
- <div class =" bsdn media" data-name =" {$attachment->getName()}" data-author =" {$attachment->getOwner()->getCanonicalName()}" >
13
- <video class =" media" src =" {$attachment->getURL()}" ></video >
14
- </div >
12
+ {if $attachment->getType() === 0}
13
+ <div class =" bsdn media" data-name =" {$attachment->getName()}" data-author =" {$attachment->getOwner()->getCanonicalName()}" >
14
+ <video class =" media" src =" {$attachment->getURL()}" ></video >
15
+ </div >
16
+ {else}
17
+ {var $driver = $attachment->getVideoDriver()}
18
+ {if !$driver}
19
+ <span style =" color:red;" >{_version_incompatibility}</span >
20
+ {else}
21
+ {$driver->getEmbed("100%")|noescape}
22
+ {/if}
23
+ {/if}
24
+
15
25
<div class =" video-wowzer" >
16
26
<img src =" /assets/packages/static/openvk/img/videoico.png" />
17
27
<a href =" /video{$attachment->getPrettyId()}" >{$attachment->getName()}</a >
You can’t perform that action at this time.
0 commit comments