Defining an Internal Video Content Type
An internal video content type must at least have the following:
-
A
media
child element belonging to the namespacehttp://xmlns.escenic.com/2013/media
. This element must have atype
attribute set tovideo
, thereby identifying the content type as a video content type managed by the Video plug-in. -
A parameter called
com.escenic.article.staging
set tofalse
, which specifies that content item staging must be disabled for this content type. If content item staging is disabled generally at your installation or for the whole publication, then you can omit this parameter. -
A
link
field
for holding a link to a locally stored video file. Thelink
element must have a childrelation
element containing the valuecom.escenic.edit-media
. -
A
basic
field with:-
mime-type
set toapplication/json
-
a
video
sub-element with anenabled
attribute set totrue
. This element must belong to the namespacehttp://xmlns.escenic.com/2010/video
.
-
-
A decorator called
videoArticleDecorator
The following example shows such a minimal
content-type
:
<content-type name="internal-video"> <media xmlns="http://xmlns.escenic.com/2013/media" type="video" enabled="true" dropable="true"/> <parameter name="com.escenic.article.staging" value="false"/> <ui:decorator name="videoArticleDecorator"/> <panel name="main"> <field name="binary" type="link"> <relation>com.escenic.edit-media</relation> </field> <field name="video" type="basic" mime-type="application/json"> <video xmlns="http://xmlns.escenic.com/2010/video" enabled="true"/> </field> </panel> </content-type>
When a new content item of this type is created in Content Studio, an
Open file dialog is automatically displayed so
that the user can upload a suitable file to the
link
field. You can use a
constraints
element to limit the file types it is
possible to upload. For example:
<field name="binary" type="link"> <constraints> <mime-type>video/mpeg</mime-type> <mime-type>video/mp4</mime-type> <mime-type>application/mxf</mime-type> </constraints> </field>
Content Studio has a default set of MIME type mappings that
cover most commonly used formats. You might, however need to change
the default settings or add new MIME types (such as the
.mxf
extension used in the example above). For
information, on how to do this, see StudioConfig.properties.
Here is a more realistic version of an internal video content type, this time including a title field, label and so on, but with the important parts highlighted.
<content-type name="internal-video"> <media xmlns="http://xmlns.escenic.com/2013/media" type="video" enabled="true" dropable="true"/> <parameter name="com.escenic.article.staging" value="false"/> <ui:icon>graphic</ui:icon> <ui:label>Internal video</ui:label> <ui:title-field>title</ui:title-field> <ui:decorator name="videoArticleDecorator"/> <panel name="main"> <field name="title" type="basic" mime-type="text/plain"/> <field name="binary" type="link"> <constraints> <mime-type>video/mpeg</mime-type> <mime-type>video/mp4</mime-type> <mime-type>application/mxf</mime-type> </constraints> </field> <field name="video" type="basic" mime-type="application/json"> <video xmlns="http://xmlns.escenic.com/2010/video" enabled="true"/> </field> </panel> </content-type>