p4a.revvervideo Package Readme ========================= Overview -------- A product providing video content stored using the `Revver XMLRPC API`_. This package allows you to mark existing content objects so that they become containers for video objects encoded and stored on the Revver_ servers. It provides a basic ui for viewing, adding, editing, and deleting these remotely stored videos. Additionally, it provides easy access to customizable AJAX widgets which display collections of videos in a convenient manner. Components ---------- The key feature of this package is a global utility (IRevverAPI) which provides some of the basic features of the `Revver XMLRPC API`_. There are also two components which make use of this API, one which creates non-persistent content objects for displaying and editing information about a video on Revver, and another which adapts any annotatable object to act as a container (zope's IContainer) for these videos. To make a particular object into a video container you can simply mark it using the ICanContainVideo interface as well as your preferred annotation interface:: You also need to enable all the functionality of ``p4a.revvervideo``, either by including it in your package:: Or making a zcml slug for it in your zope instance. Once this is done, an adapter to the video containment interface (IRevverVideoContainer) is available on the object, as well as a number of views. The primary view for managing videos is ``video-summary.htm`` which provides a listing of contained videos, along with the ability to add new videos and delete existing videos. Adding a video is simple, you will be asked to enter some metadata about the video on an initial form, which will create the video object on the Revver_ servers, store a reference to that video in the content object/video container, and also create/update a ``collection`` on the Revver_ servers which mirrors the contents Zope video container. After submitting the metadata for the video, you are taken to a second form for uploading the video itself. The video will be uploaded directly to Revver_, and may be uploaded in any of the many formats accepted there. The video will be processed and re-encoded into flash and quicktime, and a thumbnail will be generated automatically. Additionally advertising will be placed (usually at the end of the video), and revenue from that advertising will be split between the owner of the Revver account to which the video was uploaded, and the affiliate account for the site on which the video was shown (these will usually be the same account when the video is viewed from the Zope site with which it is associated). When the upload finishes you will be taken back to the video summary view, where you can see the status of your uploaded video as it gets processed and made public. From the summary view you may remove videos, which will remove them from the Revver_ servers as well as from the container, or view the video directly. The view on the video uses a traversal namespace ``++revervideo++`` along with the Revver_ video id to create an IRevverVideo object on the fly which can be viewed or edited directly (only the metadata is available for editing). There is also a view called ``collection-widget.htm`` which makes use of the AJAX `collection widget`_ provided by Revver_ to display a nice listing of the videos in an ICanContainVideo object, along with a nice lightbox style display of the videos themselves. The widget is highly customizable, and the view takes some optional arguments to allow the customization of its display. Configuration ----------- In order for all this to work, you need to supply credentials for a valid Revver_ account (accounts on Revver_ are free and simple to setup) in the ``config.py`` of this package. The package runs in ``DEBUG`` mode by default. This means that any videos you create will be created on the `Revver staging servers`_ which is not where you will want your videos to be once you have tested the product and are ready to use it in production. You can switch to using the production servers by simply setting ``DEBUG = False`` in ``config.py``. There is also a configurable ``AFFILIATEID`` to which revenue will be assigned for videos viewed on your site (this is generally the same as your account username). You may also set the minimum and maximum rating (MPAA style) for videos to be viewed on your site using the ``MAX_AGE`` and ``MIN_AGE`` constants in config.py. Note: the collection widget will only work properly if you are not in ``DEBUG`` mode. TODO ----- Some possible future improvements include the following: * Use AFFILIATEID for videos viewed directly on the site (i.e. not via the collection widget) * Use persistent objects for IRevverVideo in order to store additional metadata about the videos, and possibly allow commenting or tagging of individual videos. * Use the revver ratings api to add user rating information to the videos on Revver_ via the views. (Possibly by utilizing the `contentratings`_ views if available) * A persistent local version of the API utility which provides the Revver_ credentials in a more flexible manner * Some functional tests for the views * Perhaps a PAS plugin that integrates the `user management API`_ (note: this is probably not something I will do), or some other way of mapping zope users onto revver users under a master account. * ... Requirements ----------- * This product has only been tested on Zope 2.9 with Five 1.4, it will almost certainly work with zope 2.10+ and may also work on Zope 3.2+ (note the inclusion of ``fivestuff.zcml`` in ``configure.zcml`` will need to be removed for this to work) * If you are using this product with Plone it is highly recommended that you install `plone.app.form`_ for much nicer form integration. Notes ----- * The creation/editing of videos is not transactional, so if a ConflictError results in a retry, multiple videos will be created (though only the referenced one will get a video uploaded to it, and so only it will appear in public listings via the widget). This also means that exceptions that cause aborted transactions may also result in irrevocable changes to the relevant object on ``Revver``, and the Zope undo functionality will of course not affect the objects on ``Revver``. * Creation and modification of videos is restricted by the revvervideo.AddVideo permission, which is assigned by default only to the Manager and Owner of the content object used as the container. Happy video uploading! Author: Alec Mitchell Sponsor: `The Daily Reel`_ .. _`Revver XMLRPC API`: http://developer.revver.com .. _Revver: http://www.revver.com .. _Revver's: http://www.revver.com .. _`collection widget`: http://developer.revver.com/?page_id=8 .. _`Revver staging servers`: http://www.staging.revver.com .. _`contentratings`: http://plone.org/products/contentratings .. _`user management API`: http://developer.revver.com/?page_id=5 .. _`plone.app.form`: http://svn.plone.org/svn/plone/plone.app.form/trunk .. _`The Daily Reel`: http://www.thedailyreel.com