You are on page 1of 9

MediaAbstractSequencingTemplate(MAST)FormatSpecification

MediaAbstractSequencingTemplate(MAST)
FormatSpecification
Contents
Revisionhistory.............................................................................................................................................................1
Introduction ..................................................................................................................................................................2
Purpose .........................................................................................................................................................................2
MASTformat.................................................................................................................................................................2
FormatSummary.......................................................................................................................................................2
MastXMLelementsummary ....................................................................................................................................3
MainsailMASTEnginereferenceimplementation ....................................................................................................6
MainsailSummary.....................................................................................................................................................6
MainsailDesign .........................................................................................................................................................6
Future ........................................................................................................................................................................8
IMastAdapter ................................................................................................................................................................8
AppendixA:MASTdocumentsample ..........................................................................................................................9

Revisionhistory
Version Notes

Authors

ReleaseDate Reviewedby

0.9

NickBrookins,
JamesMutton,
WillLaw,Charles
Newman

03/30/2009

Originaldraft

NickBrookins,James
Mutton,WillLaw,Charles
Newman,JamieSherry

MASTSpecification

Page1

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

Introduction
TheMediaAbstractSequencingTemplate(MAST)isadeclarativelanguageandmarkupspecificationbasedon
XMLthatdefinesasetoftriggersthatdefinewheneventscalledtriggersshouldbeacteduponbasedonasetof
associatedconditions.MASTiscurrentlydesignedinconjunctionwitheffortsintheOpenVideoInitiativetobean
opensolutiontoaddresssequencingandlayoutforadvertisingattheplayerlevel.WhileMASThasthepotential
tosatisfyawiderangeofusecasesbeyondadvertising,theyarebeyondthecurrentscope.

Purpose
MASTisproposedbyAkamaiasanopenstandardforthesequencingofinstreamadvertisingcontent.MASTis
designedtobecompatiblewithandsupplementaltootherstandardssuchasVASTandVPAIDwhichhavebeen
designedbytheDigitalVideoCommitteeoftheInteractiveAdvertisingBureau(IAB).WhileVASTdefinesthe
contentoftheadvertisingexperienceandVPAIDprovidesastandardforadplayerinteraction,thereisalsoa
needforacommonapproachtoaddresssequencingandresolvetheissueofhavingdifferentsequencing
implementationsforeverydeployment.OurintentisforMASTtobecomeanIABrecommendedformatforusein
sequencingadvertisingwithinamediaplayerandfurtherthevalueofhavingastandardsbasedapproachforin
streamadvertising.

MASTformat
FormatSummary
MASTisadeclarativelanguageandmarkupspecificationbasedonXML.Itdefinesthe'where'and'when'with
eventsandtriggersthatcauseplayeractivitybasedonasetofconditions.Itreferencestheadcontentviaalink
toaVASTdocument,thepayloadofthetrigger.
ThebasicstructureoftheMASTdocumentis:

Triggerswithinthemastdocument
Conditionsdefiningwhenthetriggersarefired,orended
Apayloadprovidinginformationtotheprocessconsumingthetrigger

TheXMLSchemaDefinition(XSD)ofMASTfordeveloperscanbefoundinhere:
http://openvideoplayer.sf.net/mast/mast.xsd.AsampleMASTdocumentcanbefoundinAppendixB.
MASTisactedonbyasequencingengineintheplayer,whichcanbeimplementedinSilverlight,Flash,oreven
JavaScript.TheMASTdocumentcanbeprovidedtotheplayerinaplaylistorwebpage,thelatterofwhich
consistsofusingtheobjecttagparametersorJavaScript.SeetheMainsailsectionformoreinformationregarding
aMASTEngineimplementation.

MASTSpecification

Page2

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

MastXMLelementsummary
Rootnode
<MAST>
Thisistherootnode.

Attributes:
o versiontheversionoftheMASTspecthatthedocumentrepresents
Children:
o triggersthecontainerelementforthelistofMASTTriggers

triggerselement
<triggers>
Thiselementisacontainerfortheindividualtriggerelements.

Parent:MAST
Children:trigger(multiple)

triggerElement
<trigger>
Thiselementdescribesanindividualtrigger.

Parent:triggers
Attributes
o id(string)areferenceforthistrigger
o description(string)userprovideddescription,forreferencepurposesonly
Children
o startConditions
o endConditions
o sources

startConditionsElement
<startConditions>
Thiselementisacontainerfortheindividualconditionelementsthataffecttheinitiationofthetrigger.

Parent:trigger
Children:condition(multiple)

MASTSpecification

Page3

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

endConditionsElement
<startConditions>
Thiselementisacontainerfortheindividualconditionelementsthataffecttherevocationofatrigger.

Parent:trigger
Children:condition(multiple)

conditionElement
<condition>
Thiselementdescribesoneconditionofthistrigger,whenaconditionevaluatestrueitcaninitiateatriggeror
revokeit,dependingonitsparent(startConditionsvsendConditions).Multipleconditionelementsaretreatedas
animplicitOR,anyoneofthemevaluatingtruewillfirethetrigger.Childconditionsaretreatedasanimplicit
AND,allchildrenofaconditionmustevaluatetruebeforeatriggerwillfire(orberevoked)fromthatcondition.
Notethateventtypeconditionscannotbechildconditionsonlypropertyconditionscan.

Attributes
o type(enum)specifiesthetypeofcondition,currently'event'or'property'
o name(string)thenameofthepropertyoreventtobeusedinevaluation
o value(string)thevaluethatapropertywillbeevaluatedagainst
o operator(enum)theoperatortouseduringevaluation:EQ,NEQ,GTR,GEQ,LT,LEQ,MOD

Parent:startConditions,endConditions,condition
Children:
o condition(multiple)asequenceofchildconditionswhichwillmustalsoevaluateforthis
conditiontofirethetrigger

sourcesElement
<sources>
Thiselementisacontainerfortheindividualsourceelementsthatdefinethepayloadforthetrigger.Eachtriger
canhavemultiplesources;anysourcesatthetoplevelarehandledindependently.Eachsourcecanalsohavea
sourceselementwhichcancontainchildsources.Thesechildrenareonlyhandlediftheparentsourcesucceeds.
Thiscanbeusefulbehaviorinthecaseofsituationslikecompanionadswhicharetiedtoalinearad.

Parent:trigger,source
Children:source(multiple)

MASTSpecification

Page4

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

sourceElement
<source>
Thesourceelementdescribesapayloadforthetrigger,whichwillbeacteduponwhenthetriggerfires.

Attributes
o uri(string)theuritoretrieveasourcefrom,forexamplealinktoaVASTdoc.
o altReference(string)Thisisusedtokeythesourceagainstaresourcealreadyknownbythe
player.Topreventcollisionsitcanbekeyedwiththeuriwhenpossible.
o format(string)theformatthissourceisin,tobeusedtodetermineahandlerforthepayload.
Exampleswouldbe'vast','uif',etc.

Parent:sources
Children:targets,sources

targetsElement
<targets>
Thiselementisacontainerfortheindividualtargetelements.Multipletargetsarehandledindependently.

Parent:source
Children:target(multiple)

targetElement
<target>
Thiselementdescribesthetargetforthepayload,theplayerwillusethisforplacementwhenthetriggerisfired.
Atargetcanbethechildofanothertarget,whichimpliesadependencyiftheparenttargetfailstoplace
correctly,thechildwillbeskipped.

Attributes
o id(string)thetypeoftarget,canbeusedforkeyingparticularpayloaditemstoatarget
o regionName(string)anamedregion/containerorothertargetthatcanbeusedbytheplayer
Parent:targets,target
Children:target(multiple)

MASTSpecification

Page5

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

MainsailMASTEnginereferenceimplementation
MainsailSummary
MainsailisanenginethathandlesaMASTdocument.WhileMASTitselfdefinestheformatoftheXMLdocument,
theenginedoestheworkofevaluatingtriggersandinformingtheowner/playerwhentriggersarereadyto
activateordeactivate,passingthepayloadalongforusebytheappropriatehandler.Mainsailisthereference
implementationforMASTandhasbeencompletedinC#foruseintheSilverlightOpenVideoPlayer.An
ActionScriptversionisalsounderdevelopmentfortheFlashOVP.
WhileMainsailisusedasanexampleofhandlingtheMASTformat,thiscouldbeaccomplishedinotherways.For
exampleaplayerorotherapplicationcouldhaveit'sownsequencinglogicthatusedMASTasaninputformat.A
MASTenginecouldsupportjustasubsetofMASTfeaturesforspecificapplications.AMASTenginecouldbe
implementedinnearlyanyprogramminglanguage,includingJavaScript.

MainsailDesign
ThissectionwilldiscusstheMainsailimplementationinC#.MainsailforC#/OVPisadistinctplugin,withaproject
calledMASTSequencingwhichcompilestoMASTSequencing.xap.Thispluginwillbeavailableinthenextrelease
ofOVP/Silverlight,expectedtobeOVPversion2.2.000.
MASTInput/Parsing
AtthehighestlevelthereisaclasscalledMainsail,whichiswhatotherapplicationcomponentswouldinteract
with.TheenginealsohasaMASTparser,whichisautogeneratedfromtheXSDschemausinganfreetoolcalled
XSD2Code.ThistoolcreatesclassesforeachmajorelementinMAST,includingTrigger,Condition,Source,and
Target.Eachclasshasadeserializemethod,typicallytheparsingisdonebypassingafullmastdocumentxml
stringintothedeserializemethodofthetoplevelMASTclass,generatedbyXSD2Code.TheMainsailclasshas
methodstoloadMASTfromastringofXML,aURLtothedocument,orbysendinganinstantiatedTrigger'object
thesemethodsusetheparsingclasseswhereapplicable.
Initialization
WhenMASTdocumentsareaddedtoMainsail,itloopsthrougheachtrigger.ForeachoneaTriggerManagerclass
isinstantiated,andpassedareferencetotheTriggeritwillbehandling.Thelogicforatriggerwasputintothe
ManagerclasssofutureschemachangescouldregeneratetheTriggerandotherclasseswithoutloosingthe
associatedlogic.OnceaTriggerManageriscreated,MainsailattachestoitsActivateandDeactivateevents.
InsideTriggerManagerincreatesaConditionManagerforeachofit'sstartandendconditionsandattachestothe
Condition's"EventFired"event,thiswillbeexplainedfurtherinalatersection.

MASTSpecification

Page6

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

ConditionPropertyEvaluation
Mainsailhasatimerwithaconfigurableperiod,typicallyabout250500ms.OneachtimerloopMainsailcallsthe
EvaluatemethodoneachTriggerManager,whichcausesthemtoevaluatetheirconditions.Propertytype
conditionsareevaluateddirectly:theTriggerManagercallsanevaluatemethodoneachcondition.Thecondition
usesthepropertynameattributetoobtainthecurrentvalueofthatproperty,forexample'Position'mightreturn
10.5seconds.
ThepropertyvalueisreturnedfromtheIMastAdapterwhichdefinesthepropertiesandeventsthattheengine
knowshowtoevaluateagainst.Thisinterfaceshouldbeimplementedbytheowneroftheengine,orbe
implementedbyanotherclassthatcangettheappropriatepropertiesandeventsonbehalfoftheengine.Inthe
caseoftheC#Mainsail,IMastAdapterisimplementedbyOvpMastAdapter,whichtranslatesthepropertiesand
eventstothoseexposedbyOVP.Inotherapplicationsthesepropertiesandeventsmaynotberelevant,anda
totallydifferentinterfacemaybeused.
Thevalueretrievedfromthepropertyiscomparedagainstthevalueattributeofthecondition,usingthespecified
operator.Forexample,iftheoperatorwasGTR(GreaterorEqual)andthevaluewas8sec,thenthiscondition
wouldevaluatetrue.Iftrue,theconditionalsoevaluatesitsownchildconditions,whicharetreatedasalogical
'AND'.Ifallofthemarealsotrue,thentheConditionManagerreturnstruefromtheevaluatecalllettingthe
TriggerManagerknowitistimetofirethe'Activated'event.Ifoneconditionfailsevaluation,theTriggerManager
movestothenext,aspeerconditionsaretreatedaslogical'OR'.
EventConditions
EventConditionsarehandledalittledifferently.Theconditionhasthenameoftheeventisistiedto,anditlooks
forthiseventontheIMastAdapter.Iffounditdynamicallyattachestoit.Nowiftheobjectthatisimplementing
IMastAdapterfiresthisevent,itishandledbytheCondition.Theconditionfirstevaluatesanychildconditions,
whichwouldalsohavetoevaluateproperlyforthistriggertoactivate.Ifchildrenalsoevaluate,theconditionfires
aneventthatbubblesuptotheTriggerManager,andfinallytoMainsailitself.Becauseeventsareasynchronous,
pollingisnotrequired.
Activation
Asdiscussed,aTriggerManagerfires'Activated'whenitspropertyconditionsevaluateproperly,orwhenanevent
firesthroughacondition.Mainsailhandlesthis,andcallsTriggerActivated,amethodexposedbyIMastAdapter.Is
passesareferencetothetrigger,whichcannowbeusedbytheconsumertohandlethepayloadappropriately.At
thispointMainsailrelinquishescontrol,asthepayloadisimplementationspecificandshouldbehandledbythe
consumingapplication.
InthecaseoftheC#OVPMainsail,theOvpMastAdapterreceivestheactivatedtrigger.Itloopsthrougheach
sourceonthetriggerandlooksforaplayerpluginthatcanhandletheformatspecifiedbythetrigger.source
formatattribute.Whenitfindsanappropriateplugin,itgivesthepayloadtothishandler.Inthecurrentexample
thisislikelyaVASTdocument,whichwouldbehandledbytheVastAdHandlerclass/plugin.

MASTSpecification

Page7

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

Deactivation
Whenapayloadhascompleted,forexamplealinearadreachesitsend,theHandlerwillcallbacktothe
IMastAdapterDeactivateTriggermethod.ThiswillcleanupanyreferencesandalsoinformMainsailthatthe
triggerhascompleted.Duringthelifetimeofatrigger,MainsailevaluatestheendconditionsoftheTriggersinthe
samewaythatitpreviouslydidforstartconditions.Ifanendconditionevaluatestrueduringthelifeofatrigger,
MainsailwilldirectlycallDeactivateTriggeronIMastAdapterrevokingthepayloadfromtheotherdirection.

Future
AtthispointtheMASTspechasstabilizedandnomajorchangesareexpectedsoon.FuturechangestoMainsail
couldincludeupdatestotheIMastAdapterinterface,tosupportadditionalpropertiesandevents.Wemaywant
toconsideranamingconvention,sothatmultipleinterfacescouldbedefined,eachwiththerelevantmembers
forvariousapplications.TherewillalsobenewimplementationsofMainsail,suchasinActionScript/Flashfor
OVP.
InC#Mainsailitself,nochangesareexpectedasnewpayloadsareintroduced.Forexample,ifweimplementa
handlerforanewAdtagformat,likeEyewonder'sUIF,itwouldinvolvecreatinganewhandlerforthispayload
format,whichwouldbetransparenttoMainsail.ThesehandlerscanbeinadifferentpluginfromMAST/Mainsail,
orintheplayer/applicationitself.

IMastAdapter
IMastAdapterisanexampleoftheinterfacethatMainsail,oranotherMASTEngine,usestoquerypropertiesand
attachtoeventsforconditionevaluation.ThisprocessisdiscussedintheMainsailsection.AsMASTcouldbe
usedinmanydifferentapplications,theremaybeaneedfordifferentinterfaces.
ThisinterfaceisdesignedforuseinaMediaPlayerapplication,andhasallpropertiesandeventsthatacondition
canreference.Thecodeisavailableathttp://openvideoplayer.sf.net/mast/IMastAdapter.cs

MASTSpecification

Page8

8/31/2009

MediaAbstractSequencingTemplate(MAST)FormatSpecification

AppendixA:MASTdocumentsample
Thefollowingisasamplethatdemonstratesaprerollwithcompanionbanner
<MAST xsi:schemaLocation="http://openvideoplayer.sf.net/mast
http://openvideoplayer.sf.net/mast/mast.xsd">
<triggers>
<trigger id="preroll" description="preroll before every item">
<startConditions>
<condition type="event" name="OnItemStart">
<condition type="property" name="Duration" operator="GEQ" value="1:00"/>
<!-- This child condition must also be true, so the pre roll only triggers
with content 1min or longer -->
</condition>
</startConditions>
<endConditions>
<condition type="event" name="OnItemEnd"/>
<!-- This 'resets' the trigger for the next clip-->
</endConditions>
<sources>
<source uri="http://api.atdmt.com/sf=VAST_PreRoll_XML_V2;" format="vast">
<sources/><!--Child sources, which would be dependant on this one -->
<targets>
<target region="Banner1" type="banner"/>
<target region="VideoArea" type="linear"/>
<!-- target can be assumed for linear, but is explicitly defined here-->
</targets>
</source>
</sources>
</trigger>
</triggers>
</MAST>

MASTSpecification

Page9

8/31/2009

You might also like