问题
I have converted a video to bytes array and stored it in MsSql Database. Now I fetch it from database and I get the byte array. I want to set this byte array as Source of media element and then show this video in WPF application.
Please suggest a way where I can convert byte array or memory stream to Media Elements Source?
I will not have permission to write on users machine, so writing a file onto user machine and then setting the source will not work for me.
回答1:
That's not directly possible. Only the MediaElement
from Silverlight supports that feature. There are some workarounds. Checkout this link.
来源:https://stackoverflow.com/questions/14181405/how-to-create-source-for-wpf-media-element-from-byte-array-using-c