SMIL Sample codes

From open-smil
Jump to: navigation, search

Advance Schedule Example

  • 2 time slots: "Mon-Fri" & "Sat-Sun"
  • 3 playback sessions each day: "08:00~12:00", "12:00~16:00" & "16:00~20:00"
<?xml version="1.0" encoding="utf-8"?>
<smil xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <head>
        <layout>
			<root-layout xml:id="display:0" width="1920" height="1080"/>
			<region xml:id="Test" width="1920" height="1080" fit="meet" mediaAlign="center"/>
			
			
		</layout>
	</head>
	<body>
		<excl repeatCount="indefinite">
			<priorityClass>	
				<!--Monday to Friday, AAAA for 08:00~12:00, AAAB for 12:00~16:00, and AAAC for 16:00~20:00-->
				<seq id="AAAA"
				begin="wallclock(R/2016-02-01T08:00/P1W);wallclock(R/2016-02-02T08:00/P1W);wallclock(R/2016-02-03T08:00/P1W);wallclock(R/2016-02-04T08:00/P1W);wallclock(R/2016-02-05T08:00/P1W)" 
				end  ="wallclock(R/2016-02-01T12:00/P1W);wallclock(R/2016-02-02T12:00/P1W);wallclock(R/2016-02-03T12:00/P1W);wallclock(R/2016-02-04T12:00/P1W);wallclock(R/2016-02-05T12:00/P1W)">
					<img src="media/1.png" region="Test"/>
				</seq>
				<seq id="AAAB"
				begin="wallclock(R/2016-02-01T12:00/P1W);wallclock(R/2016-02-02T12:00/P1W);wallclock(R/2016-02-03T12:00/P1W);wallclock(R/2016-02-04T12:00/P1W);wallclock(R/2016-02-05T12:00/P1W)" 
				end  ="wallclock(R/2016-02-01T16:00/P1W);wallclock(R/2016-02-02T16:00/P1W);wallclock(R/2016-02-03T16:00/P1W);wallclock(R/2016-02-04T16:00/P1W);wallclock(R/2016-02-05T16:00/P1W)">
					<img src="media/2.png" region="Test"/>
				</seq>
				<seq id="AAAC"
				begin="wallclock(R/2016-02-01T16:00/P1W);wallclock(R/2016-02-02T16:00/P1W);wallclock(R/2016-02-03T16:00/P1W);wallclock(R/2016-02-04T16:00/P1W);wallclock(R/2016-02-05T16:00/P1W)" 
				end  ="wallclock(R/2016-02-01T20:00/P1W);wallclock(R/2016-02-02T20:00/P1W);wallclock(R/2016-02-03T20:00/P1W);wallclock(R/2016-02-04T20:00/P1W);wallclock(R/2016-02-05T20:00/P1W)">
					<img src="media/3.png" region="Test"/>
				</seq>
				<!--Saturday to Sunday, WAAA for 08:00~12:00, WAAB for 12:00~16:00, and WAAC for 16:00~20:00-->
				<seq id="WAAA" 
				begin="wallclock(R/2016-02-06T08:00/P1W);wallclock(R/2016-02-07T08:00/P1W)" 
				end="wallclock(R/2016-02-06T12:00/P1W);wallclock(R/2016-02-07T12:00/P1W)">
					<img src="media/4.png" region="Test"/>
				</seq>
				<seq id="WAAB" 
				begin="wallclock(R/2016-02-06T12:00/P1W);wallclock(R/2016-02-07T12:00/P1W)" 
				end="wallclock(R/2016-02-06T16:00/P1W);wallclock(R/2016-02-07T16:00/P1W)">
					<img src="media/5.png" region="Test"/>
				</seq>
				<seq id="WAAC" 
				begin="wallclock(R/2016-02-06T16:00/P1W);wallclock(R/2016-02-07T16:00/P1W)" 
				end="wallclock(R/2016-02-06T20:00/P1W);wallclock(R/2016-02-07T20:00/P1W)">
					<img src="media/6.png" region="Test"/>
				</seq>
				
				<seq id="interval_1" begin="AAAA.end" end="AAAA.begin">
					<!--null seq-->
				</seq>
				<seq id="interval_2" begin="AAAB.end" end="AAAB.begin">
					<!--null seq-->
				</seq>
				<seq id="interval_3" begin="AAAC.end" end="AAAC.begin">
					<!--null seq-->
				</seq>
				<seq id="interval_4" begin="WAAA.end" end="WAAA.begin">
					<!--null seq-->
				</seq>
				<seq id="interval_5" begin="WAAB.end" end="WAAB.begin">
					<!--null seq-->
				</seq>
				<seq id="interval_6" begin="WAAC.end" end="WAAC.begin">
					<!--null seq-->
				</seq>
				
			</priorityClass>
		</excl>

	</body>
</smil>

Dual output Example

<?xml version="1.0"?>
<smil xmlns="http://www.w3.org/ns/SMIL" version="3.0" baseProfile="Language">
  <head>
    <meta name="title" content="Video Tests" />
    <layout>
      <root-layout xml:id="DualScreen" backgroundColor="#5f3e3e" width="3840" height="1080" />
      <region xml:id="img1" left="0"    top="0"   width="1920" height="1080" z-index="1"/>
	  <region xml:id="img2" left="1920"    top="0"   width="1920" height="1080" z-index="1"/>
	  <region xml:id="imgL" left="0"    top="0"   width="1920" height="1080" mediaAlign="midLeft" z-index="1"/>
	  <region xml:id="imgR" left="1920"    top="0"   width="1920" height="1080" mediaAlign="midRight" z-index="1"/>
	  
	</layout>
  </head>
  <body>
	<par>
        <seq >
            <img src="img/amberheard-1.jpg" region="img1" fit="fill" dur="5s"/>
            <img src="img/apinkinthegreen-1.jpg" region="img1" fit="fill" dur="5s"/>
            <img src="img/autumncapital-1.jpg" region="img1" fit="fill" dur="5s"/>
        </seq>
		<seq >
            <img src="img/amberheard-2.jpg" region="img2" fit="fill" dur="5s"/>
            <img src="img/apinkinthegreen-2.jpg" region="img2" fit="fill" dur="5s"/>
            <img src="img/autumncapital-2.jpg" region="img2" fit="fill" dur="5s"/>
        </seq>
	</par>
	<par>
        <seq >
            <img src="img/dual_1.jpg" region="imgL" fit="hidden" dur="5s"/>
            <img src="img/dual_2.jpg" region="imgL" fit="hidden" dur="5s"/>
            <img src="img/dual_3.jpg" region="imgL" fit="hidden" dur="5s"/>
        </seq>
		<seq >
            <img src="img/dual_1.jpg" region="imgR" fit="hidden" dur="5s"/>
            <img src="img/dual_2.jpg" region="imgR" fit="hidden" dur="5s"/>
            <img src="img/dual_3.jpg" region="imgR" fit="hidden" dur="5s"/>
        </seq>	
	</par>
  </body>
</smil>

HDMI Input Example

<?xml version="1.0" encoding="utf-8"?>
<smil xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <head>
        <layout>
            <root-layout width="3840" height="2160" />
            <region id="Video1" top="0" left="0" width="100%" height="100%" z-index="1" fit="fill" />
            <region xml:id="web" width="35%" height="25%" left="0" top="0" fit="fill" z-index="1" mediaAlign="center" backgroundColor="transparent" />
            <region xml:id="stock" width="100%" height="4%" left="0" top="96%" fit="fill" z-index="2" mediaAlign="center" backgroundColor="#010101" />
			<region id="hdmiin" width="45%" height="45%" right="3%" bottom="6%" z-index="5" fit="fill" />
        </layout>
    </head>
    <body>
		<par>
			<prefetch src="media/60FPS_Audio_Sync_Test.mp4" />
			<prefetch src="media/30FPS_Audio_Sync_Test.mp4" />
		</par>
		<par>
            <seq repeatCount="indefinite">
				<video src="media/60FPS_Audio_Sync_Test.mp4" region="Video1" fit="fill" dur="10s" />
				<video src="media/30FPS_Audio_Sync_Test.mp4" region="Video1" fit="fill"/>
            </seq>
			<seq repeatCount="indefinite">
			    <seq dur="25s"/>
			    <video src="smartapi:capture" region="r1" dur="25s"/>			
			</seq>
        </par>
    </body>
</smil>