Skip to content

Commit

Permalink
Merge 270aeb0 into 5a21299
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed Mohammad Ibrahim committed Oct 19, 2019
2 parents 5a21299 + 270aeb0 commit c57088b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
Binary file added examples/static/movie.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/templates/homepage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from tempy.tags import *

examples = {"Hello World":"/hello_world", "Star Wars":"/star_wars",
"List":"/list", "Static Image":"/static", "Table":"/table", "CSS":"/css"}
"List":"/list", "Static Image":"/static", "Table":"/table", "CSS":"/css", "Video Tag":"/video_tag"}

container = Div()(
'content: ', Div()('this is the content')
Expand Down
21 changes: 21 additions & 0 deletions examples/templates/video_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- coding: utf-8 -*-

from tempy.tags import *

# Place a video in the folder ./static to display

page = Html()(
Head()(
Title()(
'Tempy - Video Tag Example'
)
),
body=Body()(
H1()("This is an example for using video element."),
Br(),
Video("autoplay muted").attr(width="320", height="240", controls="True")(
Source().attr(src="./static/movie.mp4", type="video/mp4"),
Source().attr(src="./static/movie.obb", type="video/obb"),
)
)
)
5 changes: 5 additions & 0 deletions examples/tempy_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ def user_page_handler():
return page.render()


@app.route('/video_tag')
def video_tag_handler():
from templates.video_tag import page
return page.render()


@app.route('/homepage')
def homepage_handler():
Expand Down

0 comments on commit c57088b

Please sign in to comment.