Using Silverlight Carousel For Video

April 11 2008

I recently used the Silverlight 2 Carousel sample I wrote for the WPF Boot Camp application and encountered a gotcha that some others may hit. Each carousel contains multiple videos, between 5 - 10.  Initially, the source of the video was coming from an mms:// URI, streamed from a Windows server. All worked no problem.  But, the video quality was sub par and I had other videos that were better quality, but not streamed over mms://. I switched to the higher quality videos, which are buffered over http://.  When I did that, the carousel would only display two videos at a time and the other panels would not display any video, even with each of the videos set with auto-play to false. I realized the reason was that the browser itself was throttling the ability of the Silverlight application to begin buffering the videos.  It would only handle two at a time.

The solution?  Rather than begin to buffer all the videos, I display screenshots of each video.  Then, when the user clicks play, I actually load and play the video. If you want the code I used to built the site, you can download it here.

I also fixed a bug in the carousel code where layout wasn't centering the carousel, which is in the latest build of the carousel.

Comments (3) -

6/6/2008 2:45:00 AM #

Dave

Hi there,
I used a portion of your carousel code to make my own app about a month ago, and today upgraded to Silverlight 2 beta2. A method I took straight from your source (it did what I needed, so why change it?) now doesn't compile, instead gives me the following error:

The best overloaded method match for 'System.Windows.Media.Animation.Storyboard.SetTargetProperty(System.Windows.Media.Animation.Timeline, System.Windows.PropertyPath)' has some invalid arguments  

this shows up in the following method:

private Storyboard BuildStoryboard(string name, double tox, double toy, double too, double tos, Duration d)
        {...
no room for the body on this post -
check out the source files.
...
        }

It's on each line that starts with 'Storyboard' (except the first one, declaring Storyboard s =  new....)

I'm not sure what to do to fix it, but I guess that if anybody might know, you'd be the guy to ask, right!?

Thanks in advance, and thanks also for the great demo app, it was a super starting point for my own project.

Dave.
          

Dave

6/6/2008 7:48:00 AM #

Dave

More precisely, the second argument cannot convert from string to System.Windows.PropertyPath

What that is. I'm new to this stuff, so have some patience with me please.
          

Dave

6/15/2008 1:14:00 AM #

Tonio

You might have to switch from
Storyboard.SetTargetProperty(day, "(Canvas.Top)");

into
Storyboard.SetTargetProperty(day, new PropertyPath("(Canvas.Top)"));
            
          

Tonio

Add comment

Enter your name, handle, alias, or email.

We'll incarnate your avatar from the services below.



biuquote
Loading