本文整理汇总了PHP中XMLWriter::EndElement方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::EndElement方法的具体用法?PHP XMLWriter::EndElement怎么用?PHP XMLWriter::EndElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLWriter
的用法示例。
在下文中一共展示了XMLWriter::EndElement方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateMPD
public function generateMPD($duration, $nStart, $nSegs)
{
$id = $this->__file->getId();
$savePath = $this->__file->getSavedir() . "{$id}.mpd";
$xml = new XMLWriter();
if (file_exists($savePath)) {
unlink($savePath);
}
$xml->openURI($savePath);
$xml->setIndent(TRUE);
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('MPD');
$xml->writeAttribute('xmlns', 'urn:mpeg:dash:schema:mpd:2011');
$xml->writeAttribute('minBufferTime', 'PT1.500000S');
$xml->writeAttribute('type', 'static');
$xml->writeAttribute('mediaPresentationDuration', 'PT0H9M56.50S');
$xml->writeAttribute('profiles', 'urn:mpeg:dash:profile:isoff-main:2011');
$xml->writeElement('BaseURL', 'http://pilatus.d1.comp.nus.edu.sg/');
//$xml->writeElement('BaseURL', 'http://pluto.comp.nus.edu.sg/');
$xml->StartElement('Period');
$xml->writeAttribute('duration', "PT{$duration[0]}H{$duration[1]}M{$duration[2]}S");
$xml->writeElement('BaseURL', "~team08/video_repo/{$id}/");
//$xml->writeElement('BaseURL', "dash/video_repo/$id/" );
$xml->StartElement('AdaptationSet');
$xml->writeAttribute('segmentAlignment', 'true');
$xml->writeAttribute('maxWidth', '720');
$xml->writeAttribute('maxHeight', '480');
$xml->writeAttribute('maxFrameRate', '30');
$xml->writeAttribute('par', '3:2');
$xml->StartElement('ContentComponent');
$xml->writeAttribute('id', '1');
$xml->writeAttribute('contentType', 'video');
$xml->EndElement();
$xml->StartElement('ContentComponent');
$xml->writeAttribute('id', '2');
$xml->writeAttribute('contentType', 'audio');
$xml->EndElement();
$xml->StartElement('Representation');
$xml->writeAttribute('id', 'HIGH');
$xml->writeAttribute('mimeType', 'video/mp4');
$xml->writeAttribute('codecs', 'avc1,mp4a');
$xml->writeAttribute('width', '720');
$xml->writeAttribute('height', '480');
$xml->writeAttribute('frameRate', '30');
$xml->writeAttribute('sar', '1:1');
$xml->writeAttribute('audioSamplingRate', '48000');
$xml->writeAttribute('bandwidth', '3000000');
$xml->StartElement('SegmentList');
$xml->writeAttribute('duration', '3');
for ($i = $nStart; $i <= $nSegs; $i++) {
$xml->StartElement('SegmentURL');
$xml->writeAttribute('media', "{$i}_720x480.mp4");
$xml->EndElement();
}
$xml->EndElement();
$xml->EndElement();
$xml->StartElement('Representation');
$xml->writeAttribute('id', 'MEDIUM');
$xml->writeAttribute('mimeType', 'video/mp4');
$xml->writeAttribute('codecs', 'avc1,mp4a');
$xml->writeAttribute('width', '480');
$xml->writeAttribute('height', '320');
$xml->writeAttribute('frameRate', '30');
$xml->writeAttribute('sar', '1:1');
$xml->writeAttribute('audioSamplingRate', '48000');
$xml->writeAttribute('bandwidth', '768000');
$xml->StartElement('SegmentList');
$xml->writeAttribute('duration', '3');
for ($i = $nStart; $i <= $nSegs; $i++) {
$xml->StartElement('SegmentURL');
$xml->writeAttribute('media', "{$i}_480x320.mp4");
$xml->EndElement();
}
$xml->EndElement();
$xml->EndElement();
$xml->StartElement('Representation');
$xml->writeAttribute('id', 'LOW');
$xml->writeAttribute('mimeType', 'video/mp4');
$xml->writeAttribute('codecs', 'avc1,mp4a');
$xml->writeAttribute('width', '240');
$xml->writeAttribute('height', '160');
$xml->writeAttribute('frameRate', '30');
$xml->writeAttribute('sar', '1:1');
$xml->writeAttribute('audioSamplingRate', '48000');
$xml->writeAttribute('bandwidth', '200000');
$xml->StartElement('SegmentList');
$xml->writeAttribute('duration', '3');
for ($i = $nStart; $i <= $nSegs; $i++) {
$xml->StartElement('SegmentURL');
$xml->writeAttribute('media', "{$i}_240x160.mp4");
$xml->EndElement();
}
$xml->EndElement();
$xml->EndElement();
$xml->EndElement();
$xml->EndElement();
$xml->EndElement();
$xml->endDocument();
$xml->flush();
}