fix nacitani videa pro webkit a fix pridavani xml
This commit is contained in:
@@ -56,7 +56,9 @@
|
|||||||
</main>
|
</main>
|
||||||
<article>
|
<article>
|
||||||
<div class="hidden" id="textInput">
|
<div class="hidden" id="textInput">
|
||||||
<div>XML soubor je pro zatím nutné vytvořit v tomto editoru. GUI editor není ještě vytvořen, ale je v plánu.
|
<div>
|
||||||
|
XML soubor je pro zatím nutné vytvořit v tomto editoru. GUI editor není ještě vytvořen, ale je v plánu. <br>
|
||||||
|
Do tagu text piště xhtml dle <a href="https://www.w3.org/TR/xhtml1/">https://www.w3.org/TR/xhtml1/</a>.
|
||||||
</div>
|
</div>
|
||||||
<div id="textArea"></div>
|
<div id="textArea"></div>
|
||||||
<input type="submit" value="Přidat video" form="form">
|
<input type="submit" value="Přidat video" form="form">
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Model {
|
|||||||
getVideoFileName(xml) {
|
getVideoFileName(xml) {
|
||||||
let parser = new DOMParser();
|
let parser = new DOMParser();
|
||||||
let xmlDoc = parser.parseFromString(xml, "text/xml");
|
let xmlDoc = parser.parseFromString(xml, "text/xml");
|
||||||
let videoTag = xmlDoc.activeElement.getAttribute("src");
|
let videoTag = xmlDoc.firstChild.getAttribute("src");
|
||||||
|
|
||||||
return videoTag;
|
return videoTag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
|||||||
);
|
);
|
||||||
$xml = $_POST["xmlFile"];
|
$xml = $_POST["xmlFile"];
|
||||||
$xml = str_replace("<video>", '<video src="' . $generatedFileName . '.' . $extension . '">', $xml);
|
$xml = str_replace("<video>", '<video src="' . $generatedFileName . '.' . $extension . '">', $xml);
|
||||||
|
$xml = str_replace("&", "&", $xml);
|
||||||
|
|
||||||
writeToFile("./videos/" . $generatedFileName . ".xml", $xml);
|
writeToFile("./videos/" . $generatedFileName . ".xml", $xml);
|
||||||
redirect("?v=" . $generatedFileName);
|
redirect("?v=" . $generatedFileName);
|
||||||
|
|||||||
Reference in New Issue
Block a user