This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang=en> | |
<head> | |
<meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"> | |
<title>Simple Video Player</title> | |
</head> | |
<body> | |
<h3>Connection Aware Video Player</h3> | |
<video id="player" width="320" height="240" controls onclick="switchVideo" poster="https://res.cloudinary.com/demo/video/upload/w_320,h_240,f_auto,q_auto/test_video_r2tk5n.jpg" autoplay muted> | |
<source src="https://res.cloudinary.com/demo/video/upload/w_320,h_240,e_preview:duration_5,f_auto,q_auto/test_video_r2tk5n"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cloudinary | |
import cloudinary.uploader | |
import cloudinary.api | |
import cloudinary.utils | |
import argparse | |
import sys, os, glob, re | |
import urllib.parse | |
cloudinary.config( | |
cloud_name = '<>', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const upload = (svgImage) => { | |
var url = uploadFile(svgImage) | |
console.log('Secure url is: ' + url) | |
return url.replace('.svg', '.png').replace('/upload/', '/upload/bo_3px_solid_rgb:00390b/b_white/l_cloudinary_icon,w_0.1,g_south_east,o_70/') | |
} | |
// *********** Upload file to Cloudinary ******************** // | |
function uploadFile (svgImage) { | |
var url = 'https://api.cloudinary.com/v1_1/mermaid/upload' | |
var xhr = new XMLHttpRequest() // eslint-disable-line |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { Divider, Card } from 'antd' | |
import { Link } from 'react-router-dom' | |
import moment from 'moment' | |
import { Base64 } from 'js-base64' | |
import mermaid from 'mermaid' | |
import { upload } from './uploader' | |
class Preview extends React.Component { | |
constructor (props) { |