Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a new wizard to automatically set up Audio/Video streaming on
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
Showing
8 changed files
with
86 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters