Skip to content
Browse files

documentation and doc strings

  • Loading branch information...
1 parent c7e22a2 commit f7783d5b3457eca5ce5ba07137fa8476d2d75568 @pvl pvl committed Oct 28, 2011
Showing with 17 additions and 2 deletions.
  1. +4 −0 docs/index.rst
  2. +13 −2 filer/models/videomodels.py
View
4 docs/index.rst
@@ -22,6 +22,10 @@ File model is used.
Default admin widget for file fields
+Uploaded videos can be automatically converted to multiple formats making it
+transparent the display of videos in formats HTML5 browsers support with
+fallback to flash for older browsers.
+
Getting help
------------
View
15 filer/models/videomodels.py
@@ -90,7 +90,9 @@ def original_format(self):
return {'url': url, 'format': fmt, 'mimetype': mimetype}
def formats_html5(self):
- """ Video formats supported by HTML5 browsers """
+ """
+ Subset of video formats to use with HTML5 browsers
+ """
HTML5_FORMATS = {'mp4':'video/mp4', 'ogv':'video/ogg','webm':'video/webm'}
_formats = []
for entry in self.formats:
@@ -100,14 +102,19 @@ def formats_html5(self):
return _formats
def format_flash(self):
- """ Returns flash video file if available """
+ """
+ Returns the flash video file if available
+ """
for entry in self.formats:
if entry['format'] == 'flv':
return {'format': entry['format'], 'url': entry['url']}
return {}
@property
def poster(self):
+ """
+ Image file to use as poster in the video display
+ """
try:
ext = 'png'
url = self.file.get_format_url(ext)
@@ -117,6 +124,10 @@ def poster(self):
return {'url': '', 'format':ext, 'filepath':''}
def convert(self):
+ """
+ Conversion of video file to alternative formats and capture of
+ poster image file
+ """
original_path = self.file.storage.path(self.file.name)
path = os.path.split(self.file.format_storage.path(self.file.name))[0]
# loop in all

0 comments on commit f7783d5

Please sign in to comment.
Something went wrong with that request. Please try again.