Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Websites UFRPE
Wagtail Videos
Commits
4d4c03a2
Commit
4d4c03a2
authored
Sep 26, 2016
by
Liam Brenner
Browse files
Make 'kw_attrs an optional dict for 'video_tag' function
parent
2437154c
Changes
1
Hide whitespace changes
Inline
Side-by-side
wagtailvideos/models.py
View file @
4d4c03a2
...
...
@@ -236,9 +236,7 @@ class AbstractVideo(CollectionMember, TagSearchable):
except
Transcode
.
DoesNotExist
:
return
self
.
do_transcode
(
media_format
)
def
video_tag
(
self
,
attrs
):
kw_attrs
=
{}
def
video_tag
(
self
,
attrs
,
kw_attrs
=
{}):
if
self
.
thumbnail
:
kw_attrs
[
'poster'
]
=
self
.
thumbnail
.
url
...
...
@@ -251,7 +249,7 @@ class AbstractVideo(CollectionMember, TagSearchable):
sources
.
append
(
"<source src='{0}' type='video/{1}' >"
.
format
(
transcode
.
url
,
transcode
.
media_format
.
name
))
sources
.
append
(
"<p>Sorry, your browser doesn't support playback for this video</p>"
)
return
mark_safe
(
"<video {0}
{1}>{2}</video>"
.
format
(
attrs
,
flatatt
(
kw_attrs
),
"
\n
"
.
join
(
sources
)))
"<video {0}{1}>{2}</video>"
.
format
(
attrs
,
flatatt
(
kw_attrs
),
"
\n
"
.
join
(
sources
)))
def
do_transcode
(
self
,
media_format
,
quality
):
transcode
,
created
=
self
.
transcodes
.
get_or_create
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment