title: Video Playing From Memory Stream
body: <p>I am working in asp.net c#. I want to play video from memory stream. I am encrypting and decrypting video. I am storing the decrypted video in memory stream, and want to play it, without saving. I have googled it and found number of post, but mostly the post are uncompleted or provided the link with directshow. I have also tried with directshow, but it's totally new for me and contains number of demos, that made a confusion which one to use for Memory stream. </p>
  
  <p>I just want to play decrypted video data from memory stream . Please let me know what I can do, it will be more good if there is a sample available from any forums.</p>
  
  <p>My decrypted code  </p>
  
  <pre><code>public bool DecryptData(String inName, String outName, byte[] rijnKey, byte[] rijnIV)
  {
     FileStream fin = null;
      FileStream fout = null;
      CryptoStream decStream = null;
  
      try
      {
              fin = new FileStream(inName, FileMode.Open, FileAccess.Read);
  
              //Create variables to help with read and write.
  
              byte[] bin = new byte[bufLen]; //This is intermediate storage for the encryption.
              long rdlen = 0; //This is the total number of bytes written.
              long totlen = fin.Length; //This is the total length of the input file.
              int len; //This is the number of bytes to be written at a time.
              RijndaelManaged rijn = new RijndaelManaged();
  
              //DES ds = new DESCryptoServiceProvider();
  
              decStream = new CryptoStream(fin, rijn.CreateDecryptor(rijnKey, rijnIV), CryptoStreamMode.Read);
  
  
              //odkoduj testowy fragment
  
              byte[] test = new byte[testHeader.Length];
              decStream.Read(test, 0, testHeader.Length);
              string contents = new StreamReader(decStream).ReadToEnd();
              byte[] unicodes = Encoding.Unicode.GetBytes(contents);
              MemoryStream msOutput = new MemoryStream(unicodes);
  //here I have to implement player that plays from memory stream.
  }
  catch
  {}
  }
  </code></pre>