Skip to content

Commit

Permalink
Adds a new wizard to automatically set up Audio/Video streaming on
Browse files Browse the repository at this point in the history
virtual servers. It also adds a little cookbook recommending to use
the wizard for setting the most common streaming configuration.


git-svn-id: svn://cherokee-project.com/cherokee/trunk@3587 5dc97367-97f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Aug 25, 2009
1 parent 206a2d2 commit 2496a8d
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 12 deletions.
3 changes: 2 additions & 1 deletion admin/Makefile.am
Expand Up @@ -119,7 +119,8 @@ Wizard_Drupal.py \
Wizard_RoR.py \
Wizard_Mailman.py \
Wizard_Icons.py \
Wizard_CommonStatic.py
Wizard_CommonStatic.py \
Wizard_Streaming.py
endif

adminpy_DATA = $(admin_data)
Expand Down
43 changes: 43 additions & 0 deletions admin/Wizard_Streaming.py
@@ -0,0 +1,43 @@
from config import *
from util import *
from Wizard import *
from configured import *

EXTENSIONS = 'mp3,ogv,flv,mov,ogg,mp4'

CONFIG = """
%(rule_pre)s!match = extensions
%(rule_pre)s!match!extensions = %(extensions)s
%(rule_pre)s!handler = streaming
%(rule_pre)s!handler!rate = 1
%(rule_pre)s!handler!rate_factor = 0.5
%(rule_pre)s!handler!rate_boost = 5
"""

class Wizard_Rules_Streaming (Wizard):
ICON = "streaming.png"
DESC = "Adds a rule to stream media files."

def __init__ (self, cfg, pre):
Wizard.__init__ (self, cfg, pre)
self.name = "Media Streaming"

def show (self):
rules = self._cfg.keys('%s!rule'%(self._pre))
for r in rules:
if self._cfg.get_val ('%s!rule!%s!match'%(self._pre, r)) != 'extensions':
continue
if self._cfg.get_val ('%s!rule!%s!match!extensions'%(self._pre, r)) == EXTENSIONS:
self.no_show = "Media streaming is already configured."
return False
return True

def _run (self, uri, post):
_, rule_pre = cfg_vsrv_rule_get_next (self._cfg, self._pre)
if not rule_pre:
return self.report_error ("Couldn't add a new rule.")

extensions = EXTENSIONS
config = CONFIG % (locals())

self._apply_cfg_chunk (config)
3 changes: 2 additions & 1 deletion admin/static/images/wizards/Makefile.am
Expand Up @@ -11,7 +11,8 @@ drupal.png \
ror.png \
mailman.png \
icons.png \
common_static.png
common_static.png \
streaming.png

EXTRA_DIST = \
$(wizards_DATA)
Binary file added admin/static/images/wizards/streaming.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions doc/Makefile.am
Expand Up @@ -67,6 +67,7 @@ cookbook_trac.html \
cookbook_phpbb.html \
cookbook_phpmyadmin.html \
cookbook_managing_logs.html \
cookbook_streaming.html \
modules.html \
modules_balancers.html \
modules_balancers_ip_hash.html \
Expand Down
11 changes: 6 additions & 5 deletions doc/cookbook.txt
Expand Up @@ -9,23 +9,24 @@
. link:cookbook_optimizations.html[Optimizing Cherokee]: Recommendations and tweaks.
. link:cookbook_redirs.html[Redirections]: Common redirection examples.
. link:cookbook_ssl.html[SSL/TLS, certs]: Secure connection tips.
. link:cookbook_alfresco.html[Alfresco]: How to run Alfresco on Cherokee.
. link:cookbook_mono.html[ASP.NET]: How to run ASP.NET apps with Mono and Cherokee.
. link:cookbook_streaming.html[Streaming]: How to stream Audio and Video with Cherokee.
. link:cookbook_php.html[PHP]: How to run PHP apps with Cherokee.
. link:cookbook_ror.html[Ruby on Rails]: How to run Ruby on Rails apps with Cherokee.
. link:cookbook_django.html[Django]: How to run Django apps with Cherokee.
. link:cookbook_drupal.html[Drupal]: How to run Drupal on Cherokee.
. link:cookbook_wordpress.html[Wordpress]: How to run Wordpress on Cherokee.
. link:cookbook_alfresco.html[Alfresco]: How to run Alfresco on Cherokee.
. link:cookbook_mono.html[ASP.NET]: How to run ASP.NET apps with Mono and Cherokee.
. link:cookbook_glassfish.html[GlassFish]: How to run Java apps with Cherokee.
. link:cookbook_joomla.html[Joomla]: How to run Joomla on Cherokee.
. link:cookbook_kumbia.html[Kumbia]: How to run Kumbia apps with Cherokee.
. link:cookbook_liferay.html[Liferay]: How to run Liferay on Cherokee.
. link:cookbook_mailman.html[Mailman]: How to run Mailman on Cherokee.
. link:cookbook_moodle.html[Moodle]: How to run Moodle on Cherokee.
. link:cookbook_nagios.html[Nagios]: How to run Nagios with Cheroke.
. link:cookbook_php.html[PHP]: How to run PHP apps with Cherokee.
. link:cookbook_phpbb.html[phpBB]: How to run phpBB on Cherokee.
. link:cookbook_phpmyadmin.html[phpMyAdmin]: How to run phpMyAdmin on Cherokee.
. link:cookbook_ror.html[Ruby on Rails]: How to run Ruby on Rails apps with Cherokee.
. link:cookbook_sugarcrm.html[SugarCRM]: How to run SugarCRM on Cherokee.
. link:cookbook_symfony.html[Symfony]: How to run Symfony apps with Cherokee.
. link:cookbook_trac.html[Trac]: How to run Trac on Cherokee.
. link:cookbook_wordpress.html[Wordpress]: How to run Wordpress on Cherokee.
. link:cookbook_zend.html[Zend]: How to run Zend apps with Cherokee.
26 changes: 26 additions & 0 deletions doc/cookbook_streaming.txt
@@ -0,0 +1,26 @@
== link:index.html[Index] -> link:cookbook.html[Cookbook]

Cookbook: Streaming Audio and Video
-----------------------------------

It's really easy to configure Cherokee so it streams audio and video
files instead of sending then as a regular file.

The first thing you have to ensure is that Cherokee has been compiled
with the required libraries. In this case, the FFMpeg library set is
required. Cherokee uses it to extract information of the media files.

[[wizard]]
Standard configuration
~~~~~~~~~~~~~~~~~~~~~~

To configure Cherokee to stream media files is trivial. The only thing
you will have to do is to choose the virtual server on which you want
to enable the streaming functionality, and then click on `Wizard`.

image::media/images/admin_vserver_wizard.png[Virtual Server Wizards]

Once in there, the only thing left to do is to click `Misc` and run
the Streaming wizard. Right after which the virtual server will be
ready to stream your media files, including MP3, OGG, OGV, MP4, etc.

11 changes: 6 additions & 5 deletions doc/index.txt
Expand Up @@ -53,25 +53,26 @@ link:cookbook.html[Cookbook]: Recipes for specific tasks
. link:cookbook_optimizations.html[Optimizing Cherokee]: Recommendations and tweaks.
. link:cookbook_redirs.html[Redirections]: Common redirection examples.
. link:cookbook_ssl.html[SSL/TLS, certs]: Secure connection tips.
. link:cookbook_alfresco.html[Alfresco]: How to run Alfresco on Cherokee.
. link:cookbook_mono.html[ASP.NET]: How to run ASP.NET apps with Mono and Cherokee.
. link:cookbook_streaming.html[Streaming]: How to stream Audio and Video with Cherokee.
. link:cookbook_php.html[PHP]: How to run PHP apps with Cherokee.
. link:cookbook_ror.html[Ruby on Rails]: How to run Ruby on Rails apps with Cherokee.
. link:cookbook_django.html[Django]: How to run Django apps with Cherokee.
. link:cookbook_drupal.html[Drupal]: How to run Drupal on Cherokee.
. link:cookbook_wordpress.html[Wordpress]: How to run Wordpress on Cherokee.
. link:cookbook_alfresco.html[Alfresco]: How to run Alfresco on Cherokee.
. link:cookbook_mono.html[ASP.NET]: How to run ASP.NET apps with Mono and Cherokee.
. link:cookbook_glassfish.html[GlassFish]: How to run Java apps with Cherokee.
. link:cookbook_joomla.html[Joomla]: How to run Joomla on Cherokee.
. link:cookbook_kumbia.html[Kumbia]: How to run Kumbia apps with Cherokee.
. link:cookbook_liferay.html[Liferay]: How to run Liferay on Cherokee.
. link:cookbook_mailman.html[Mailman]: How to run Mailman on Cherokee.
. link:cookbook_moodle.html[Moodle]: How to run Moodle on Cherokee.
. link:cookbook_nagios.html[Nagios]: How to run Nagios with Cheroke.
. link:cookbook_php.html[PHP]: How to run PHP apps with Cherokee.
. link:cookbook_phpbb.html[phpBB]: How to run phpBB on Cherokee.
. link:cookbook_phpmyadmin.html[phpMyAdmin]: How to run phpMyAdmin on Cherokee.
. link:cookbook_ror.html[Ruby on Rails]: How to run Ruby on Rails apps with Cherokee.
. link:cookbook_sugarcrm.html[SugarCRM]: How to run SugarCRM on Cherokee.
. link:cookbook_symfony.html[Symfony]: How to run Symfony apps with Cherokee.
. link:cookbook_trac.html[Trac]: How to run Trac on Cherokee.
. link:cookbook_wordpress.html[Wordpress]: How to run Wordpress on Cherokee.
. link:cookbook_zend.html[Zend]: How to run Zend apps with Cherokee.

*********************************
Expand Down

0 comments on commit 2496a8d

Please sign in to comment.