Possible to replay drm protected media

May 8, 2011 at 2:07 PM

When the player has finished playing a drm protected media (progressive download) I want the media to play again if I click the play button.

What happens when the media ends is:

  • MediaEnded event is thrown.
  • GoToNextPlaylistItem is called.
  • Play State is set to Closed

Nothing happens when I press the play button and the method SMFPlayer.Play is called.

I guess nothing happens because play state is Closed, but how do I change that since SMFPlayer.CurrentPlaylistItem still contains the same playlistItem?

May 8, 2011 at 4:13 PM

pingu, you can call SeekToPosition(0) to reset the position before calling .Play().


May 8, 2011 at 4:55 PM

Thanks for your answer, but unfortunately it doesn't do the trick.

It however works with non drm media, where play state is set to Paused and media position has the same value as the media duration, when the media ends.

With drm protected video the media position is already 0 (I guess it's so since play state is Closed and the media element doesn't contain any media).

May 8, 2011 at 5:21 PM

Ah, that makes sense. Try resetting the Playlist to a new ObservableCollection<PlaylistItem> then readd your playlistitem.

You also might be able to just clear the playlist (haven't tested this):

var currentItem = Player.CurrentPlaylistItem;




Hope this helps,


May 9, 2011 at 7:58 AM

:-( Nope.

I got this error log though:

"Error Occurred Configuring Media Plugin: The LicenseAcquirer has already been bound to a MediaElement"

Does this mean that I have to recreate the smf-player in order to play the media again?

May 9, 2011 at 9:33 AM

Pingu, regarding that last error: try to set the licenseaquirer on the OnMediaPluginLoaded event, so it enforces a new one everytime.

Global variable: licenseUrl (holds the string representation of the license delivery url)

        protected override void OnMediaPluginLoaded()


            if (!String.IsNullOrEmpty(licenseUrl))
                Uri lcs;
                Uri.TryCreate(licenseUrl, UriKind.RelativeOrAbsolute, out lcs);

                var licenseAcquirer = ActiveMediaPlugin.LicenseAcquirer;
                    licenseAcquirer.LicenseServerUriOverride = lcs;
                catch {
                    MessageBox.Show("Player failed to assign License Acquirer.");
                ActiveMediaPlugin.LicenseAcquirer.LicenseServerUriOverride = null;

May 9, 2011 at 2:26 PM
Edited May 9, 2011 at 2:27 PM

luisfaustino, now it works beautifully! Thanks a lot!!