Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ddcf6836
Commit
ddcf6836
authored
May 07, 2012
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Videos now support annotations w/o verticals
parent
3cddaa46
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
djangoapps/courseware/modules/video_module.py
+12
-7
templates/video.html
+8
-0
No files found.
djangoapps/courseware/modules/video_module.py
View file @
ddcf6836
...
...
@@ -42,7 +42,8 @@ class Module(XModule):
return
render_to_string
(
'video.html'
,{
'streams'
:
self
.
video_list
(),
'id'
:
self
.
item_id
,
'position'
:
self
.
position
,
'name'
:
self
.
name
})
'name'
:
self
.
name
,
'annotations'
:
self
.
annotations
})
def
get_init_js
(
self
):
'''JavaScript code to be run when problem is shown. Be aware
...
...
@@ -52,19 +53,23 @@ class Module(XModule):
log
.
debug
(
u"INIT POSITION {0}"
.
format
(
self
.
position
))
return
render_to_string
(
'video_init.js'
,{
'streams'
:
self
.
video_list
(),
'id'
:
self
.
item_id
,
'position'
:
self
.
position
})
'position'
:
self
.
position
})
+
self
.
annotations_init
def
get_destroy_js
(
self
):
return
"videoDestroy(
\"
{0}
\"
);"
.
format
(
self
.
item_id
)
return
"videoDestroy(
\"
{0}
\"
);"
.
format
(
self
.
item_id
)
+
self
.
annotations_destroy
def
__init__
(
self
,
xml
,
item_id
,
ajax_url
=
None
,
track_url
=
None
,
state
=
None
,
track_function
=
None
,
render_function
=
None
):
XModule
.
__init__
(
self
,
xml
,
item_id
,
ajax_url
,
track_url
,
state
,
track_function
,
render_function
)
self
.
youtube
=
etree
.
XML
(
xml
)
.
get
(
'youtube'
)
self
.
name
=
etree
.
XML
(
xml
)
.
get
(
'name'
)
xmltree
=
etree
.
fromstring
(
xml
)
self
.
youtube
=
xmltree
.
get
(
'youtube'
)
self
.
name
=
xmltree
.
get
(
'name'
)
self
.
position
=
0
if
state
!=
None
:
state
=
json
.
loads
(
state
)
if
'position'
in
state
:
self
.
position
=
int
(
float
(
state
[
'position'
]))
#log.debug("POSITION IN STATE")
#log.debug(u"LOAD POSITION {0}".format(self.position))
self
.
annotations
=
[(
e
.
get
(
"name"
),
self
.
render_function
(
e
))
\
for
e
in
xmltree
]
self
.
annotations_init
=
""
.
join
([
e
[
1
][
'init_js'
]
for
e
in
self
.
annotations
if
'init_js'
in
e
[
1
]])
self
.
annotations_destroy
=
""
.
join
([
e
[
1
][
'destroy_js'
]
for
e
in
self
.
annotations
if
'destroy_js'
in
e
[
1
]])
templates/video.html
View file @
ddcf6836
...
...
@@ -122,3 +122,11 @@
});
</script>
</
%
block>
<ol
class=
"video-mod"
>
% for t in annotations:
<li
id=
"video-${annotations.index(t)}"
>
${t[1]['content']}
</li>
% endfor
</ol>
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