locked
PlayToSource does not update when using a Bitmap from StorageFile instead of Uri RRS feed

  • Question

  • Hello,

    I'm demonstrating the problem (bug?) with the Media PlayTo Sample.

    In Scenario 2 (pictures) of the C# version, this line update the target and streams the image:

    ImageSource.Source = new BitmapImage(new Uri("ms-appx:///Assets/" + ((ListBoxItem)Playlist.SelectedItem).Content.ToString())); 

    In real life we do not have Uris to the picture and media we want to work with (!) but StorageFile (which is actually very nice).

    So change the said line in the sample project to this:

    StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/" + ((ListBoxItem)Playlist.SelectedItem).Content.ToString()));
    BitmapImage bi = new BitmapImage();
    await bi.SetSourceAsync(await file.OpenReadAsync());
    ImageSource.Source = bi;
    

    The only difference is, that the BitmapImage is not created from a Uri, but from the IRandomAccessStream of the StorageFile (OpenReadAsync..).

    But the picture is only streamed when the connection is first established. Afterwards it will never update on the remote device.


    Can someone please take a look at this? From my understanding there should not be a difference! (And it's blocking me from implementing PlayTo...)

    best wishes and merry christmas!
    michael


    Life is unsure - always eat the dessert first!

    Thursday, December 26, 2013 9:13 AM

All replies

  • Hi,

    I test the project. When I use a Bitmap from StorageFile instead of Uri, everything was Ok in my computer. The picture source can update when your click the play button.Please wait for a while to see the update.

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, December 27, 2013 2:45 AM
  • Hello Anne,

    I tested it again, but there's a definitive difference. I use remote debugging to run the application on a tablet and use Windows Media Player on my laptop to receive the data.

    With the new BitmapImage(new Uri(...)); everything works as expected. The laptop will show the picture in less than half a second.

    With a new BitmapImage(await file.OpenReadAsync()); the first image will be shown right after the connection was established. Selecting another picture (by automatic playlist, or manually) will update the picture on the tablet, but not on the laptop.

    This is really weird...

    cheers


    Life is unsure - always eat the dessert first!

    Friday, December 27, 2013 8:47 AM
  • Hi,

    I do not have an environment to test the problem.
    I will escalate the thread and ask other engineers to help you!

    Best Wishes!



    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    • Edited by Anne Jing Monday, December 30, 2013 7:12 AM edit
    Monday, December 30, 2013 7:12 AM
  • Hi Michael,

    I reproed the issue, and based on code on Quickstart: Using Play To in applications (Windows Store apps using C#/VB/C++ and XAML) using IRandomAccessStream , add a timer, etc, the issue is reproed,too. Unfortunately further debugging code is beyond the scope of a forum post. Please feel free to open a support incident. Please go here: http://aka.ms/storesupport.

    Regards,

    Jenny

    Thursday, January 2, 2014 2:50 AM