Index: /trunk/ova.flowplayer/dist/js/ova-examples.js
===================================================================
--- /trunk/ova.flowplayer/dist/js/ova-examples.js	(revision 186)
+++ /trunk/ova.flowplayer/dist/js/ova-examples.js	(revision 187)
@@ -12,5 +12,5 @@
 var IN_TEST_MODE = false;
 var ACTIVE_OVA_OAS_VERSION = "ova.swf"
-var OVA_OAS_DEBUG = 'fatal, config, vast_template, tracking_events';
+var OVA_OAS_DEBUG = 'fatal, config, vast_template, segment_formation, playlist';
 
 
Index: /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as
===================================================================
--- /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as	(revision 186)
+++ /trunk/ova.flowplayer/src/org/openvideoads/plugin/flowplayer/streamer/OpenAdStreamer.as	(revision 187)
@@ -71,5 +71,5 @@
      
         protected static var CONTROLBAR_HEIGHT:int = 29;   
-        public static var OAS_VERSION:String = "v0.5.2.10";
+        public static var OAS_VERSION:String = "v0.5.2.11";
         
         protected static var STREAMING_PROVIDERS:Object = {
@@ -274,5 +274,5 @@
 			     			},
 			     			null,
-			     			_player.playlist.clips[index].start
+			     			Timestamp.secondsToTimestamp(_player.playlist.clips[index].start)
 				     )
 				); 
@@ -381,6 +381,6 @@
 			var clip:Clip = new ScheduledClip();
 			clip.type = ClipType.fromMimeType(event.stream.mimeType); 
-			clip.start = event.stream.getStartTimeAsSeconds();
 			if(event.stream is AdSlot) {
+				clip.start = 0;
 				if(!event.stream.isStream()) {
 					clip.duration = event.stream.getDurationAsInt();
@@ -395,4 +395,5 @@
 			}
 			else {
+				clip.start = event.stream.getStartTimeAsSeconds();
 				if(!_vastController.deriveShowDurationFromMetaData()) {
 					if(event.stream.hasDuration()) {
Index: /trunk/ova.flowplayer/examples/flowplayer-specific/index.html
===================================================================
--- /trunk/ova.flowplayer/examples/flowplayer-specific/index.html	(revision 139)
+++ /trunk/ova.flowplayer/examples/flowplayer-specific/index.html	(revision 187)
@@ -25,4 +25,5 @@
 <li><a href="example14.html">Maintaining 4:3 in a 16:9 player</a></li>
 <li><a href="example15.html">Using loop:false on the JS Playlist Plugin</a></li>
+<li><a href="example16.html">Ad scheduled playlist item with a start time and restricted duration</a></li>
 </ol>
 <p class="example">
Index: /trunk/ova.flowplayer/examples/start-time/example01.html
===================================================================
--- /trunk/ova.flowplayer/examples/start-time/example01.html	(revision 6)
+++ /trunk/ova.flowplayer/examples/start-time/example01.html	(revision 187)
@@ -3,5 +3,5 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<title>Example 1 - A pre-roll and show stream with an overlay ad</title>
+<title>Example 1 - A pre-roll and show stream with a duration, no start time and an overlay ad</title>
 <script type="text/javascript" src="../../dist/js/jquery-1.3.1.js"></script>
 </head>
@@ -14,9 +14,6 @@
 -->
 </style>
-<h2>Example 1 - A pre-roll and show stream with an overlay ad</h2>
+<h2>Example 1 - A pre-roll and show stream with a duration, no start time and an overlay ad</h2>
 <p class="example">
-A 30 second pre-roll ad plays followed by the show stream. 5 seconds into the show stream an
-overlay appears for 15 seconds - click on the overlay to start up a video ad. Once the video
-ad has played, the show stream resumes at the point at which the overlay was clicked.
 </p>
 <a class="example"></a>
@@ -33,5 +30,5 @@
 
             "shows": {
-              "streams": [ { "file":OVA_HTTP_SHOW_STREAM_1, "duration":"00:00:30" } ]
+              "streams": [ { "file":OVA_PSEUDO_SHOW_STREAM_1, "duration":"00:00:30" } ]
             },
 
@@ -74,6 +71,6 @@
 
             "debug": {
-              "levels": "fatal",
-              "debugger": OVA_OAS_DEBUG
+              "levels": OVA_OAS_DEBUG,
+              "debugger": "firebug"
             }
         }
@@ -99,5 +96,5 @@
                  "streams": [
                       {
-                          "file": "<script type="text/javascript">document.write(OVA_HTTP_SHOW_STREAM_1)</script>",
+                          "file": "<script type="text/javascript">document.write(OVA_PSEUDO_SHOW_STREAM_1)</script>",
                           "duration":"00:00:30"
                       }
@@ -142,5 +139,5 @@
 
               "debug": {
-                  "levels": "fatal",
+                  "levels": "<script type="text/javascript">document.write(OVA_OAS_DEBUG)</script>",
                   "debugger": "firebug"
               }
Index: /trunk/ova.flowplayer/examples/start-time/example02.html
===================================================================
--- /trunk/ova.flowplayer/examples/start-time/example02.html	(revision 6)
+++ /trunk/ova.flowplayer/examples/start-time/example02.html	(revision 187)
@@ -3,5 +3,5 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<title>Example 2 - Start time and duration in Shows stream definition</title>
+<title>Example 2 - A pre-roll on a show stream with a start time and duration</title>
 <script type="text/javascript" src="../../dist/js/jquery-1.3.1.js"></script>
 </head>
@@ -14,5 +14,5 @@
 -->
 </style>
-<h2>Example 2 - Start time and duration in Shows stream definition</h2>
+<h2>Example 2 - A pre-roll on a show stream with a start time and duration</h2>
 <p class="example">
 A pre-roll is played before a show stream that starts 15 seconds in and runs for
@@ -62,5 +62,5 @@
                   {
                     "zone": "5",
-                      "position": "post-roll"
+                      "position": "pre-roll"
                   }
               ],
Index: /trunk/ova.flowplayer/examples/start-time/example03.html
===================================================================
--- /trunk/ova.flowplayer/examples/start-time/example03.html	(revision 6)
+++ /trunk/ova.flowplayer/examples/start-time/example03.html	(revision 187)
@@ -3,5 +3,5 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<title>Example 3 - A pre-roll and show stream with an overlay ad</title>
+<title>Example 3 - A pre-roll and show stream with a start time but no duration, and an overlay ad</title>
 <script type="text/javascript" src="../../dist/js/jquery-1.3.1.js"></script>
 </head>
@@ -14,9 +14,6 @@
 -->
 </style>
-<h2>Example 3 - A pre-roll and show stream with an overlay ad</h2>
+<h2>Example 3 - A pre-roll and show stream with a start time but no duration, and an overlay ad</h2>
 <p class="example">
-A 30 second pre-roll ad plays followed by the show stream. 5 seconds into the show stream an
-overlay appears for 15 seconds - click on the overlay to start up a video ad. Once the video
-ad has played, the show stream resumes at the point at which the overlay was clicked.
 </p>
 <a class="example"></a>
@@ -33,5 +30,5 @@
 
             "shows": {
-              "streams": [ { "file":OVA_HTTP_SHOW_STREAM_1, "duration":"00:00:30" } ]
+              "streams": [ { "file":OVA_PSEUDO_SHOW_STREAM_1, "duration":"00:00:30" } ]
             },
 
@@ -99,5 +96,5 @@
                  "streams": [
                       {
-                          "file": "<script type="text/javascript">document.write(OVA_HTTP_SHOW_STREAM_1)</script>",
+                          "file": "<script type="text/javascript">document.write(OVA_PSEUDO_SHOW_STREAM_1)</script>",
                           "duration":"00:00:30"
                       }
Index: /trunk/ova.flowplayer/examples/start-time/example04.html
===================================================================
--- /trunk/ova.flowplayer/examples/start-time/example04.html	(revision 6)
+++ /trunk/ova.flowplayer/examples/start-time/example04.html	(revision 187)
@@ -3,5 +3,5 @@
 <head>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
-<title>Example 4 - Start time without a duration in Shows stream definition</title>
+<title>Example 4 - A post-roll on a show stream with a start time but no duration</title>
 <script type="text/javascript" src="../../dist/js/jquery-1.3.1.js"></script>
 </head>
@@ -14,5 +14,5 @@
 -->
 </style>
-<h2>Example 4 - Start time without a duration in Shows stream definition</h2>
+<h2>Example 4 - A post-roll on a show stream with a start time but no duration</h2>
 <p class="example">
 A pre-roll is played before a show stream that starts 15 seconds in and runs for
@@ -45,5 +45,5 @@
               "streams": [ 
               		{ 
-              			"file":OVA_HTTP_SHOW_STREAM_1, 
+              			"file":OVA_PSEUDO_SHOW_STREAM_1, 
               			"startTime": "00:00:15"
               		} 
@@ -61,5 +61,5 @@
                   {
                     "zone": "5",
-                      "position": "pre-roll"
+                      "position": "post-roll"
                   }
               ],
@@ -92,5 +92,5 @@
                  "streams": [
                       {
-                          "file": "<script type="text/javascript">document.write(OVA_HTTP_SHOW_STREAM_1)</script>",
+                          "file": "<script type="text/javascript">document.write(OVA_PSEUDO_SHOW_STREAM_1)</script>",
                           "startTime":"00:00:15"
                       }
@@ -108,5 +108,5 @@
                       {
                            "zone": "5",
-                           "position": "pre-roll"
+                           "position": "post-roll"
                       }
                   ],
@@ -114,5 +114,5 @@
 
               "debug": {
-                  "levels": "fatal",
+                  "levels": "<script type="text/javascript">document.write(OVA_OAS_DEBUG)</script>",
                   "debugger": "firebug"
               }
Index: /trunk/ova.flowplayer/examples/start-time/index.html
===================================================================
--- /trunk/ova.flowplayer/examples/start-time/index.html	(revision 139)
+++ /trunk/ova.flowplayer/examples/start-time/index.html	(revision 187)
@@ -10,8 +10,10 @@
 </p>
 <ol>
-<li><a href="example01.html">A pre-roll and show stream (with a duration) with an overlay ad</a></li>
-<li><a href="example02.html">Start time and duration in Shows stream definition</a></li>
-<li><a href="example03.html">A pre-roll and show stream (without a duration) with an overlay ad</a></li>
-<li><a href="example04.html">Start time without a duration in Shows stream definition</a></li>
+<li><a href="example01.html">A pre-roll and show stream with a duration, no start time and an overlay ad</a></li>
+<li><a href="example02.html">A pre-roll on a show stream with a start time and duration</a></li>
+<li><a href="example03.html">A pre-roll and show stream with a start time but no duration, and an overlay ad</a></li>
+<li><a href="example04.html">A post-roll on a show stream with a start time but no duration</a></li>
+<li><a href="example05.html">Start time on show and mid-roll and 2 overlays - duration-less show</a></li>
+<li><a href="example06.html">Start time on show and mid-roll and 2 overlays - with show duration</a></li>
 </ol>
 <p class="example">
Index: /trunk/ova.as3/src/org/openvideoads/vast/schedule/StreamSequence.as
===================================================================
--- /trunk/ova.as3/src/org/openvideoads/vast/schedule/StreamSequence.as	(revision 98)
+++ /trunk/ova.as3/src/org/openvideoads/vast/schedule/StreamSequence.as	(revision 187)
@@ -152,21 +152,25 @@
 			if(declareTrackingPoints) stream.declareTrackingPoints(0);
 			_sequence.push(stream);
-//			_vastController.onScheduleStream(_sequence.length-1, stream);
 		}
 		
 		public function addRemainingStreamSlice(streams:Array, streamMetrics:Object, label:String, totalDuration:int):int {
 			var startTimestamp:String = Timestamp.secondsToTimestamp(streamMetrics.usedActiveShowDuration);
+			var isSlice:Boolean = true;
+			if(streams[streamMetrics.associatedStreamIndex].startTime != undefined && streams[streamMetrics.associatedStreamIndex].startTime != null) {
+				// it's not a slice if there was a startTime specified for the stream and we are starting there
+				isSlice = !(streams[streamMetrics.associatedStreamIndex].startTime == startTimestamp);
+			}
 			addStream(new Stream(this,
 			                     _vastController,
 			                     _sequence.length,
 			                     label + streamMetrics.associatedStreamIndex + "-" + _sequence.length,
-			                     streams[streamMetrics.associatedStreamIndex].id, //filename,
+			                     streams[streamMetrics.associatedStreamIndex].id, 
 							     startTimestamp,
-							     new String(streamMetrics.totalActiveShowDuration), //new String(streamMetrics.remainingActiveShowDuration),
+							     new String(streamMetrics.totalActiveShowDuration), 
 							     new String(streamMetrics.totalActiveShowDuration),
 							     true,
 			                     streams[streamMetrics.associatedStreamIndex].hasBaseURL() ? streams[streamMetrics.associatedStreamIndex].baseURL : _baseURL,
-							     "any", //mp4
-							     "any", //"streaming",
+							     "any", 
+							     "any", 
 							     -1,
 								 streams[streamMetrics.associatedStreamIndex].playOnce,
@@ -177,5 +181,5 @@
 						 		 null,
 								 streamMetrics.associatedStreamIndex,
-								 true,
+								 isSlice,
 								 streams[streamMetrics.associatedStreamIndex].customProperties,
 								 streams[streamMetrics.associatedStreamIndex].fireTrackingEvents)); 
@@ -214,12 +218,12 @@
 									                     m1, 
 									                     "show-k-" + m + "-" + _sequence.length, 
-									                     streams[m1].id, //filename, 
-									                     streams[m1].startTime, //"00:00:00", 
+									                     streams[m1].id,  
+									                     streams[m1].startTime,  
 									                     Timestamp.timestampToSecondsString(streams[m1].duration), 
 									                     Timestamp.timestampToSecondsString(streams[m1].duration), 
 									                     streams[m1].reduceLength, 
 									                     streams[m1].hasBaseURL() ? streams[m1].baseURL : _baseURL,
-													     "any", //mp4
-													     "any", //"streaming",
+													     "any", 
+													     "any", 
 													     -1,
 										                 streams[m1].playOnce,					
@@ -244,5 +248,10 @@
 					}
 					if(streams.length > 0) {
-						currentMetrics.totalActiveShowDuration = Timestamp.timestampToSeconds(streams[adSlots[i].associatedStreamIndex].duration);						
+						currentMetrics.totalActiveShowDuration = Timestamp.timestampToSeconds(streams[adSlots[i].associatedStreamIndex].duration);
+						if(currentMetrics.usedActiveShowDuration == 0 && Timestamp.timestampToSeconds(streams[adSlots[i].associatedStreamIndex].startTime) > 0) {
+							// a start time is specified, so set the starting point on the stream accordingly
+							doLog("Show stream has a start time specified - setting starting point in schedule to " + streams[adSlots[i].associatedStreamIndex].startTime, Debuggable.DEBUG_SEGMENT_FORMATION);
+							currentMetrics.usedActiveShowDuration = Timestamp.timestampToSeconds(streams[adSlots[i].associatedStreamIndex].startTime);
+						}	
 					}
 					if(!adSlots[i].isLinear() && adSlots[i].isActive()) {
@@ -270,12 +279,12 @@
 										                     m, 
 										                     "show-b-" + m + "-" + _sequence.length, 
-										                     streams[m].id, //filename, 
-										                     streams[m].startTime, //"00:00:00", 
+										                     streams[m].id, 
+										                     streams[m].startTime, 
 										                     Timestamp.timestampToSecondsString(streams[m].duration), 
 										                     Timestamp.timestampToSecondsString(streams[m].duration), 
 										                     streams[m].reduceLength, 
 										                     streams[m].hasBaseURL() ? streams[m].baseURL : _baseURL,
-														     "any", //mp4
-														     "any", //"streaming",
+														     "any", 
+														     "any", 
 														     -1,
 										                     streams[m].playOnce,					
@@ -315,12 +324,12 @@
 										                     n, 
 										                     "show-cf-" + n + "-" + _sequence.length, 
-										                     streams[n].id, //filename, 
-										                     streams[n].startTime, //"00:00:00", 
+										                     streams[n].id,  
+										                     streams[n].startTime,  
 										                     Timestamp.timestampToSecondsString(streams[n].duration), 
 										                     Timestamp.timestampToSecondsString(streams[n].duration), 
 										                     streams[n].reduceLength, 
 										                     streams[n].hasBaseURL() ? streams[n].baseURL : _baseURL,
-														     "any", //mp4
-														     "any", //"streaming",
+														     "any", 
+														     "any", 
 														     -1,
 										                     streams[n].playOnce,					
@@ -346,5 +355,5 @@
 									                     _sequence.length,
 									                     "show-d-" + adSlots[i].associatedStreamIndex + "-" + _sequence.length,
-									                     streams[adSlots[i].associatedStreamIndex].id, //filename, 
+									                     streams[adSlots[i].associatedStreamIndex].id, 
 													     Timestamp.secondsToTimestamp(currentMetrics.usedActiveShowDuration),
 														 new String(showSliceDuration),
@@ -352,6 +361,6 @@
 														 true,
 									                     streams[adSlots[i].associatedStreamIndex].hasBaseURL() ? streams[adSlots[i].associatedStreamIndex].baseURL : _baseURL,
-													     "any", //mp4
-													     "any", //"streaming",
+													     "any", 
+													     "any", 
 													     -1,
 														 streams[adSlots[i].associatedStreamIndex].playOnce,
@@ -391,12 +400,12 @@
 											                     o, 
 											                     "show-hf-" + o + "-" + _sequence.length, 
-											                     streams[o].id, //filename, 
-											                     streams[o].startTime, //"00:00:00", 
+											                     streams[o].id, 
+											                     streams[o].startTime, 
 											                     Timestamp.timestampToSecondsString(streams[o].duration), 
 											                     Timestamp.timestampToSecondsString(streams[o].duration), 
 											                     streams[o].reduceLength, 
 											                     streams[o].hasBaseURL() ? streams[o].baseURL : _baseURL,
-															     "any", //mp4
-															     "any", //"streaming",
+															     "any",
+															     "any", 
 															     -1,
 											                     streams[o].playOnce,					
@@ -457,12 +466,12 @@
 						                     x, 
 						                     "show-g-" + x, 
-						                     streams[x].id, //filename, 
-						                     streams[x].startTime, //"00:00:00", 
+						                     streams[x].id,  
+						                     streams[x].startTime, 
 						                     Timestamp.timestampToSecondsString(streams[x].duration), 
 						                     Timestamp.timestampToSecondsString(streams[x].duration), 
 						                     streams[x].reduceLength, 
 						                     streams[x].hasBaseURL() ? streams[x].baseURL : _baseURL,
-										     "any", //mp4
-										     "any", //"streaming",
+										     "any", 
+										     "any", 
 										     -1,
 						                     streams[x].playOnce,					
@@ -489,12 +498,12 @@
 					                     j, 
 					                     "show-h-" + j, 
-					                     streams[j].id, //filename, 
-					                     streams[j].startTime, //"00:00:00", 
+					                     streams[j].id, 
+					                     streams[j].startTime, 
 					                     Timestamp.timestampToSecondsString(streams[j].duration), 
 					                     Timestamp.timestampToSecondsString(streams[j].duration), 
 					                     streams[j].reduceLength, 
 					                     streams[j].hasBaseURL() ? streams[j].baseURL : _baseURL,
-									     "any", //mp4
-									     "any", //"streaming",
+									     "any", 
+									     "any",
 									     -1,
 					                     streams[j].playOnce,					
@@ -504,5 +513,5 @@
 								 		 streams[j].player,
 								 		 null,
-								 		 j, //previousMetrics.associatedStreamIndex,
+								 		 j, 
 								 		 false,
 								 		 streams[j].customProperties,
Index: /trunk/ova.as3/src/org/openvideoads/vast/schedule/Stream.as
===================================================================
--- /trunk/ova.as3/src/org/openvideoads/vast/schedule/Stream.as	(revision 184)
+++ /trunk/ova.as3/src/org/openvideoads/vast/schedule/Stream.as	(revision 187)
@@ -82,5 +82,5 @@
 		                       reducedLength:Boolean=false, 
 		                       baseURL:String=null, 
-		                       streamType:String="any", //mp4 
+		                       streamType:String="any", 
 		                       deliveryType:String="streaming", 
 		                       bitrate:* = -1, 
