1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
video.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\UI\Viewer\Renderer;
4
5
use Bitrix\Main\Loader;
6
use Bitrix\Main\Web\Uri;
7
8
class
Video
extends
Renderer
9
{
10
const
WIDTH
= 700;
11
const
HEIGHT
= 700;
12
13
const
JS_TYPE_VIDEO
=
'video'
;
14
15
public
function
getWidth
()
16
{
17
return
$this->
getOption
(
'width'
, self::WIDTH);
18
}
19
20
public
function
getHeight
()
21
{
22
return
$this->
getOption
(
'height'
, self::HEIGHT);
23
}
24
25
public
static
function
getJsType
()
26
{
27
return
self::JS_TYPE_VIDEO;
28
}
29
30
public
static
function
getAllowedContentTypes
()
31
{
32
return
[
33
'video/mp4'
,
34
'video/x-flv'
,
35
'video/webm'
,
36
'video/ogg'
,
37
'video/quicktime'
,
38
];
39
}
40
41
public
function
render
()
42
{
43
Loader::includeModule
(
'fileman'
);
44
45
return \CJSCore::getHTML([
'player'
]);
46
}
47
48
public
function
getData
()
49
{
50
$data
= [
51
'width'
=> $this->
getWidth
(),
52
'height'
=> $this->
getHeight
(),
53
'contentType'
=> $this->
getOption
(
'contentType'
),
54
'src'
=>
$this->sourceUri
,
55
];
56
57
$sources
= [
58
[
59
'src'
=>
$this->sourceUri
,
60
'type'
=> $this->
getOption
(
'contentType'
),
61
]
62
];
63
$sources
= $this->modifySourcesByDirtyHacks(
$sources
);
64
65
$altSrc = $this->
getOption
(
'alt.sourceUri'
);
66
if
($altSrc)
67
{
68
array_unshift(
$sources
, [
69
'src'
=> $altSrc,
70
'type'
=> $this->
getOption
(
'alt.contentType'
),
71
]);
72
}
73
$data
[
'sources'
] =
$sources
;
74
75
return
$data
;
76
}
77
78
protected
function
modifySourcesByDirtyHacks(
array
$sources
)
79
{
80
$updatedSources =
$sources
;
81
foreach
(
$sources
as $source)
82
{
83
if
($source[
'type'
] ===
'video/quicktime'
)
84
{
85
//some browser can work with quicktime :)
87
$src = clone $source[
'src'
];
88
$src->addParams([
'fakeUnique'
=>
'qt'
,]);
89
90
$updatedSources[] = [
91
'src'
=> $src,
92
'type'
=>
'video/mp4'
,
93
];
94
}
95
}
96
97
return
$updatedSources;
98
}
99
}
Bitrix\Main\Loader\includeModule
static includeModule($moduleName)
Определения
loader.php:67
Bitrix\Main\UI\Viewer\Renderer\Renderer
Определения
renderer.php:9
Bitrix\Main\UI\Viewer\Renderer\Renderer\$sourceUri
$sourceUri
Определения
renderer.php:14
Bitrix\Main\UI\Viewer\Renderer\Renderer\getOption
getOption($name, $defaultValue=null)
Определения
renderer.php:25
Bitrix\Main\UI\Viewer\Renderer\Video
Определения
video.php:9
Bitrix\Main\UI\Viewer\Renderer\Video\HEIGHT
const HEIGHT
Определения
video.php:11
Bitrix\Main\UI\Viewer\Renderer\Video\JS_TYPE_VIDEO
const JS_TYPE_VIDEO
Определения
video.php:13
Bitrix\Main\UI\Viewer\Renderer\Video\getAllowedContentTypes
static getAllowedContentTypes()
Определения
video.php:30
Bitrix\Main\UI\Viewer\Renderer\Video\getData
getData()
Определения
video.php:48
Bitrix\Main\UI\Viewer\Renderer\Video\WIDTH
const WIDTH
Определения
video.php:10
Bitrix\Main\UI\Viewer\Renderer\Video\getJsType
static getJsType()
Определения
video.php:25
Bitrix\Main\UI\Viewer\Renderer\Video\getHeight
getHeight()
Определения
video.php:20
Bitrix\Main\UI\Viewer\Renderer\Video\getWidth
getWidth()
Определения
video.php:15
Bitrix\Main\UI\Viewer\Renderer\Video\render
render()
Определения
video.php:41
$data
$data['IS_AVAILABLE']
Определения
.description.php:13
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$sources
$sources
Определения
options.php:35
bitrix
modules
main
lib
ui
viewer
renderer
video.php
Создано системой
1.14.0