mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-24 00:50:28 +00:00
36 lines
741 B
JavaScript
36 lines
741 B
JavaScript
|
/*\
|
||
|
title: $:/core/modules/parsers/videoparser.js
|
||
|
type: application/javascript
|
||
|
module-type: parser
|
||
|
|
||
|
The video parser parses a video tiddler into an embeddable HTML element
|
||
|
|
||
|
\*/
|
||
|
(function(){
|
||
|
|
||
|
/*jslint node: true, browser: true */
|
||
|
/*global $tw: false */
|
||
|
"use strict";
|
||
|
|
||
|
var AudioParser = function(type,text,options) {
|
||
|
var element = {
|
||
|
type: "element",
|
||
|
tag: "video",
|
||
|
attributes: {
|
||
|
controls: {type: "string", value: "controls"}
|
||
|
}
|
||
|
},
|
||
|
src;
|
||
|
if(options._canonical_uri) {
|
||
|
element.attributes.src = {type: "string", value: options._canonical_uri};
|
||
|
} else if(text) {
|
||
|
element.attributes.src = {type: "string", value: "data:" + type + ";base64," + text};
|
||
|
}
|
||
|
this.tree = [element];
|
||
|
};
|
||
|
|
||
|
exports["video/mp4"] = AudioParser;
|
||
|
|
||
|
})();
|
||
|
|