offline reproduction issue

Topics: Windows 8 Xaml
Jan 4, 2013 at 7:31 AM

Hi.

I'm using Microsoft.PlayerFramework.MediaPlayer and I want to create an offline smooth streaming video player. I have implemented the interface to cache the chunks but when I try to play the video i get the following exception:

MF_MEDIA_ENGINE_ERR_DECODE : HRESULT - 0x80004004

from the event: moviesPlayer.MediaFailed.

Do anyone have an example or anykind of guideline about the offline reproduction?

Thanks,

regards.

Gio


Interface code:

IAsyncOperation<DownloaderResponse> IDownloaderPlugin.RequestAsync(DownloaderRequest pDownloaderRequest)
{
    return Task.Run<DownloaderResponse>(async () =>
    {
        string chunckUrl = pDownloaderRequest.RequestUri.ToString();
        string qualityLevel = string.Empty;
        DownloaderResponse response;
        string chunckName = string.Empty;
        try
        {
            qualityLevel = Utils.getQualityLevel();
            chunckName = Utils.GenerateChunckName();

            StorageFolder movieFolder = await _appData.GetFolderAsync("Movie");
            StorageFile chunckFile = await movieFolder.GetFileAsync(chunckNameShort);
                   
            IRandomAccessStream str = await chunckFile.OpenAsync(FileAccessMode.Read);

            string contentType = Utils.GetContentType();

            string url = pDownloaderRequest.RequestUri.ToString().Substring(0, pDownloaderRequest.RequestUri.ToString().LastIndexOf('/')) + "/" + chunckName;

            response = new DownloaderResponse(new Uri(url), str, str.Size, contentType, null, true);
                    
            return response;
        }
        catch
        {
            response = new DownloaderResponse(pDownloaderRequest.RequestUri, null, null);
            return response;
        }

    }).AsAsyncOperation<DownloaderResponse>();
}