AutoPlay = false ignored when adding PlaylistItems programmatically

May 2, 2011 at 3:50 PM

I've encountered something that I think is a bug in SMFPlayer.

I have a single SMFPlayer instance in a UserControl. In the XAML, it has this setup: AutoPlay="False" AutoLoad="True". It hasn't got any item in its playlist.

When I have picked a file to play in my application, I create a new PlaylistItem as appropriate, then add it:

PlaylistItem item = new PlaylistItem();
item.MediaSource = (DataContext as Video).MediaUri;
item.ThumbSource = (DataContext as Video).ImageUri;
item.DeliveryMethod = DeliveryMethods.AdaptiveStreaming;

If I do just that, the Player will start playing as soon as it gets the stream. The AutoPlay property stays false when in breakpoints, so it's not set elsewhere.


I've found a workaround currently: I use AddPlayBlock(object) and ReleasePlayBlock(object) to hold it until I want it to play, but it feels wrong.

Has anybody encountered this issue as well? Should I file a bug?

May 6, 2011 at 8:55 AM

I would really like to have a proper fix for this, as I had to add another workaround.

Using the method above (AddPlayBlock() / ReleasePlayBlock()), sometimes the video playback doesn't start when using Player.Play() (!). So I added Player.Play in the MediaOpened event...

It really feels like piling workarounds and kludges :(

May 8, 2011 at 3:39 PM

Julienv42, I am not able to duplicate this. Setting AutoPlay="False" prevents the video from playing for me using the code you provided above.

fyi: AutoLoad determines whether or not the CurrentPlaylistitem should be set (which causes the smooth streaming plugin to load the manifest but not actually start playing the video).

AutoPlay tells the smooth streaming plugin whether or not it should actually play the video.

AddPlayBlock & ReleasePlayBlock are for advertising scenarios to prevent programmatic playback of the main video at the same time an ad is playing on top of the video area.


May 9, 2011 at 8:06 AM

It seems I only have the issue when using "live" streams, not "file". I'm not sure about the terminology, what I have in my app currently is both VOD-type streams (which work fine), and live TV stream which start when it wants, and not when I want. Everything is Smooth Streaming.

Thanks for looking into this!

May 11, 2011 at 1:53 PM
Edited May 12, 2011 at 9:02 AM

EDIT: wrong!

In fact, no, it doesn't work for my VOD streams either :(

If I remove the play block, the video start immediately.

May 11, 2011 at 3:10 PM
Edited May 11, 2011 at 3:10 PM

Julienv42, can you duplicate this in a simple test app and send it to me? As mentioned, I wasn't able to duplicate the problem so I assume we must be doing something slightlly different.



May 12, 2011 at 8:33 AM

I've made a very small project that still has the issue. Where can I send you the files?

May 12, 2011 at 9:02 AM

Ah... sorry for the contradicting messages!

My message from Monday was accurate, not the one from Wednesday.

So to sum it up : the issue only occurs with Live content, not with VOD content.

Jun 27, 2011 at 3:25 PM

Same happens for me. 

When using adding a .isml as a playlist item the Autoplay=false setting is ignored.

I managed to force it in OnMediaOpened event, but as state above, this looks like a bug.


Actually, my interest is that the player only loads the manifest when Play button is clicked, so that the chunks dont get sent, and so perserve bandwith.


Any ideas?