本文介绍了如何将mp4文件读入IBuffer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用Windows Store  App。  我有一个MP4文件。我应该把MP4文件读到IBuffer。然后我应该使用IBuffer来流式传输。

I am using Windows Store App.  I have a MP4 file . I should read the MP4 file to IBuffer. Then I should use the IBuffer to Stream.

但是当我在带有视频的html中显示它时,它无法正常工作(显示
无效代码

But it can not work well when I display it in html with video (Displayinvalid code)

我不知道此代码有什么问题:

I do not know what is wrong with this code:

    StorageFile  mp4File = item as StorageFile;

    StorageFile mp4File = item as StorageFile;

    IBuffer newBuffer = await FileIO.ReadBufferAsync(mp4File);

    IBuffer newBuffer = await FileIO.ReadBufferAsync(mp4File);

    InMemoryRandomAccessStream inputData = new InMemoryRandomAccessStream();

    IOutputStream outputStream = inputData.GetOutputStreamAt(0);

     DataWriter writer = new DataWriter(outputStream);

     writer.WriteBuffer(newBuffer,0,newBuffer.Length);

    await writer.StoreAsync();

     await writer.FlushAsync();

    InMemoryRandomAccessStream inputData = new InMemoryRandomAccessStream();
    IOutputStream outputStream = inputData.GetOutputStreamAt(0);
    DataWriter writer = new DataWriter(outputStream);
    writer.WriteBuffer(newBuffer, 0, newBuffer.Length);
    await writer.StoreAsync();
    await writer.FlushAsync();

推荐答案


这篇关于如何将mp4文件读入IBuffer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-23 02:16