-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from klepp-me/feature/static_video_page
Add static video page to render share urls
- Loading branch information
Showing
7 changed files
with
70 additions
and
3 deletions.
There are no files selected for viewing
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
Empty file.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from fastapi import APIRouter | ||
|
||
from app.render import video_player | ||
|
||
api_router = APIRouter() | ||
api_router.include_router(video_player.router, tags=['video']) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
from fastapi import APIRouter, Request | ||
from fastapi.responses import HTMLResponse | ||
from fastapi.templating import Jinja2Templates | ||
|
||
templates = Jinja2Templates(directory='templates') | ||
|
||
router = APIRouter() | ||
|
||
|
||
@router.get('/', response_class=HTMLResponse, include_in_schema=False) | ||
async def render_video_page(request: Request, path: str): | ||
return templates.TemplateResponse('video.html', {'request': request, 'path': path}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta property="og:title" content="Klepp"/> | ||
<meta property="og:type" content="website"/> | ||
<meta property="og:url" content="https://gg.klepp.me/{{path}}"/> | ||
<meta property="og:video" content="https://gg.klepp.me/{{path}}"/> | ||
<meta property="og:video:type" content="application/x-shockwave-flash"> | ||
<meta property="og:video:width" content="398"> | ||
<meta property="og:video:height" content="264"> | ||
<meta property="og:image" content="https://klepp.me/favicon.ico"/> | ||
<meta name="theme-color" content="#FF0000"> | ||
<title>Klepp video</title> | ||
<style> | ||
body {background: linear-gradient(90deg,#0f2027,#36474f 50%,#2c5364)} | ||
.videoplayer {width: 100%; height: 100%} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="videoplayer"> | ||
<video controls> | ||
<source src="https://gg.klepp.me/{{path}}" type="video/mp4"> | ||
Your browser does not support the video tag. | ||
</video> | ||
</div> | ||
</body> | ||
</html> |