File tree Expand file tree Collapse file tree
Presenters/templates/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,5 +14,5 @@ abstract function getThumbnailURL(): string;
1414
1515 abstract function getURL (): string ;
1616
17- abstract function getEmbed (): string ;
17+ abstract function getEmbed (string $ w = 600 , string $ h = 340 ): string ;
1818}
Original file line number Diff line number Diff line change @@ -13,12 +13,12 @@ function getURL(): string
1313 return "https://youtu.be/ $ this ->id " ;
1414 }
1515
16- function getEmbed (): string
16+ function getEmbed (string $ w = " 600 " , string $ h = " 340 " ): string
1717 {
1818 return <<<CODE
1919 <iframe
20- width="600 "
21- height="340 "
20+ width=" $ w "
21+ height=" $ h "
2222 src="https://www.youtube-nocookie.com/embed/ $ this ->id "
2323 frameborder="0"
2424 sandbox="allow-same-origin allow-scripts allow-popups"
Original file line number Diff line number Diff line change 99 </a >
1010 {/if}
1111{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+
1525 <div class =" video-wowzer" >
1626 <img src =" /assets/packages/static/openvk/img/videoico.png" />
1727 <a href =" /video{$attachment->getPrettyId()}" >{$attachment->getName()}</a >
You can’t perform that action at this time.
0 commit comments