2013-02-13 2 views
1

J'utilise SMFPlayer dans le kit de développement SilverLight Smooth Streaming. Et je suis en mesure de lire du contenu vidéo, mais pour une raison quelconque, nous voulons avoir le contrôle sur les données téléchargées et analysées. Pour ce faire, nous voulons commencer à utiliser l'interface ISmoothStreamingCache . Je veux savoir quelle est la bonne approche pour accrocher l'objet ISmoothStreamingCache dans SMFPlayer.comment accrocher l'objet ISmoothStreamCache dans SMFPlayer (kit de développement Smooth Streaming)

Merci à l'avance

Big O

+0

Pour votre information. Assurez-vous que vous avez un constructeur vide. J'ai dû vérifier le journal du joueur pour le découvrir. –

Répondre

0

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 
    } 
} 
Questions connexes