mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-05-02 15:34:10 +00:00

* remove blks first try * dprint.json seems to be OK, some forgotten functions * add some more space-after-keyword settings * server remove blks * add **/files to dprint exclude * dprint.js fixes a typo * add boot.js and bootprefix.js to dprint exclude * dprint change dprint.json * add dprint fmt as script * remove jslint comments * fix whitespace * fix whitespace * remove function-wrapper from geospatial plugin * fix whitespace * add function wrapper to dyannotate-startup * remove dpring.json
36 lines
886 B
JavaScript
36 lines
886 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
|
|
|
|
\*/
|
|
|
|
"use strict";
|
|
|
|
var VideoParser = function(type,text,options) {
|
|
var element = {
|
|
type: "element",
|
|
tag: "video",
|
|
attributes: {
|
|
controls: {type: "string", value: "controls"},
|
|
style: {type: "string", value: "width: 100%; object-fit: contain"}
|
|
}
|
|
},
|
|
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];
|
|
this.source = text;
|
|
this.type = type;
|
|
};
|
|
|
|
exports["video/ogg"] = VideoParser;
|
|
exports["video/webm"] = VideoParser;
|
|
exports["video/mp4"] = VideoParser;
|
|
exports["video/quicktime"] = VideoParser;
|