La mise en œuvre ISmoothStreamingCache's
devrait également mettre en œuvre l'interface IPlugin
. Il devrait également être décoré avec l'attribut ExportAdaptiveCacheProvider
.
Ensuite, il sera automatiquement accroché au SMFPlayer.
est le squelette du code ci-dessous pour la classe:
using System;
using System.Collections.Generic;
using System.IO.IsolatedStorage;
using System.Net;
using Microsoft.SilverlightMediaFramework.Plugins;
using Microsoft.SilverlightMediaFramework.Plugins.Metadata;
using Microsoft.Web.Media.SmoothStreaming;
namespace MyNamespace
{
[ExportAdaptiveCacheProvider(PluginName = "My Smooth Streaming Cache")]
public class MySmoothStreamingCache : ISmoothStreamingCache, IPlugin
{
public MySmoothStreamingCache()
{
// Your implementation
}
#region ISmoothStreamingCache members
public IAsyncResult BeginRetrieve(CacheRequest request, AsyncCallback callback, object state)
{
// Your implementation
}
public CacheResponse EndRetrieve(IAsyncResult ar)
{
// Your implementation
}
public IAsyncResult BeginPersist(CacheRequest request, CacheResponse response, AsyncCallback callback, object state)
{
// Your implementation
}
public bool EndPersist(IAsyncResult ar)
{
// Your implementation
}
public void OpenMedia(Uri manifestUri)
{
// Your implementation
}
public void CloseMedia(Uri manifestUri)
{
// Your implementation
}
#endregion
#region IPlugin members
public bool IsLoaded { get; private set; }
public void Load()
{
IsLoaded = true;
}
public event Action<IPlugin, Microsoft.SilverlightMediaFramework.Plugins.Primitives.LogEntry> LogReady;
public event Action<IPlugin, Exception> PluginLoadFailed;
public event Action<IPlugin> PluginLoaded;
public event Action<IPlugin, Exception> PluginUnloadFailed;
public event Action<IPlugin> PluginUnloaded;
public void Unload()
{
IsLoaded = false;
}
#endregion
}
}
Pour votre information. Assurez-vous que vous avez un constructeur vide. J'ai dû vérifier le journal du joueur pour le découvrir. –