A Visual Studio Express 2012 experiment

Jul 31, 2015 at 5:14 PM
Edited Aug 3, 2015 at 2:41 AM
Hi henric and everyone in the community,

I'm recently looking into the Win7 HLSView Sample to use the library. For some reason I was working on Visual Studio Express 2012. I'm just here to happily share my findings. It shall be even more interesting if someone have some time to discuss with me.

First of all I did manage to run the sample code, for the sample code are utilizing DLLs and they worked fine on my VS2012EX. There was a weird symptom though when I tried to directly migrate the sample to my project. Some sort of "Could not load file or assembly 'System.Net.Http.<I_FORGOT_TH_ENAME>, Version=1.5.0.0, Culture=neutral" exception was fired when I tried to include SM.media.platform.WP7.dll so I referenced the whole source code project.

I was really happy when I saw my app worked on my 8.0 emulator. However when I started to test for WP7 devices, I discovered that the library does not work well in this case (It is saying: "Could not load type 'SM.Media.Utility.RandomGenerators.XorShift1024Star' from assembly 'SM.Media.Legacy, Version=1.5.3.0, Culture=neutral, PublicKeyToken=A8A96D0F02112EBC'.") so the stream doesn't play. I then tried to migrate to phonesm-1.4.7 instead of 1.5.2

The 1.4.7 library sure is playing for my WP7 devices but it doesn't seek when I set the "mediaelement.position". I looked into this and conclude that the seekAsync(timespan) was fired with a 0:00 timespan. I thus added a "_mediastreamfacade.seekTarget = time" assignment to force the seek. At first everything seems to be alright but I later discovered that the "_mediastreamfacade.state" never leave seeking state after the first "mediaelement.position" set, with or without setting the .seekTarget (while the mediastreamsource itself is in play state). I discovered that this is the root cause for my mediaelement not properly playing (very lag) after every seek (Even if I allocate a new mediaelement each time I started my page). After some search I have placed my bet on the WP8 bad buffering indicator story (Can't find the link again lol but I'm pretty sure I found 2 links here about the WP8 mediaelement has a broken buffering status. Not sure if this is still the case, though.)

After all these, I was a little bit frustrated and decided to look into the Sample.WP7, however no luck till now. The Windows Phone 7s are simply not playing. I mean the sample does not work on my WP7 devices, and this time even phonesm 1.4.7 gave me no luck :P

Some other notes:

The only track that works for me is the Apple bip-bop (Nasa ... and others seem to be broken? or are they not accessible form my country?)

Every once out of ten, my App freeze at the line player.source = null (or sometimes other operation on it) when I called player.stop() but before I call _mediastreamfacade.disposeBackground(). So I decided to not call player.stop()

Thank you for your patiently reading! Feedback much welcomed!
Aug 3, 2015 at 11:31 AM
Update:

The only working version utilizing playerframework for me is 1.4-alpha

I thought the seeking problem was solved but the lag still seems to exist.
Aug 4, 2015 at 6:09 AM
Update:

Seems like this only happens when the seek is to early (I have a resume at last played place feature)

The first seek (Triggered by open) is already finished, but the next seek would still make the video goes laggy.

I did a mandatory 2 second sleep to fix this.