An interesting suggestion was made with regard to my intended use of embedded “heartbeat” markers. Mike Loynd (WL) referred me to this fascinating article by John Deutscher (PM for IIS Media). That caused me to experiment with the following code in the HVP Silverlight Video Player,
public partial class Player : Page
{
private readonly DispatcherTimer timer;
public Player()
{
InitializeComponent();
timer = new DispatcherTimer { Interval = new TimeSpan( 500 ) };
timer.Tick += new EventHandler( timer_Tick );
timer.Start();
}
void timer_Tick(object sender, EventArgs e)
{
var position = CoreMedia.Position;
var minutes = position.Minutes;
var seconds = position.Seconds;
var milliseconds = position.Milliseconds;
TopPlaceHolder.Content =
string.Format("{0:d2}:{1:d2}:{2:d4}",
minutes, seconds, milliseconds);
}
from Jesse Liberty more here