-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathclass.ilInteractiveVideoOpenCastXMLParser.php
More file actions
81 lines (73 loc) · 1.58 KB
/
class.ilInteractiveVideoOpenCastXMLParser.php
File metadata and controls
81 lines (73 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
require_once 'Customizing/global/plugins/Services/Repository/RepositoryObject/InteractiveVideo/classes/class.ilInteractiveVideoXMLParser.php';
/**
* Class ilInteractiveVideoOpenCastXMLParser
*/
class ilInteractiveVideoOpenCastXMLParser extends ilInteractiveVideoXMLParser
{
/**
* @var
*/
protected $opc_obj;
/**
* @param $opencast_obj
* @param $xmlFile
*/
public function __construct($opencast_obj, $xmlFile)
{
$this->opc_obj = $opencast_obj;
$this->setHandlers($xmlFile);
}
/**
* @param $xmlParser
* @param $tagName
* @param $tagAttributes
*/
public function handlerBeginTag($xmlParser, $tagName, $tagAttributes): void
{
switch($tagName)
{
case 'OpcId':
case 'OpcURL':
case 'VideoSourceObject':
$this->cdata = '';
break;
}
}
/**
* @param $xmlParser
* @param $tagName
*/
public function handlerEndTag($xmlParser, $tagName): void
{
switch($tagName)
{
case 'OpcId':
$this->opc_obj->setFauId(trim($this->cdata));
break;
case 'OpcURL':
$this->opc_obj->setFauUrl(trim($this->cdata));
break;
case 'VideoSourceObject':
$tmp = $this->cdata;
break;
}
}
private function fetchAttribute($attributes, $name)
{
if( isset($attributes[$name]) )
{
return $attributes[$name];
}
return null;
}
/**
* @param $xmlParser
*/
public function setHandlers($a_xml_parser): void
{
xml_set_object($a_xml_parser, $this);
xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
}
}