I have a couple of apps with embedded YouTube video playlists. On both the Emulator and the Device I can retrieve video feeds (thumbnails & video info) without any trouble. The apps work perfectly in the Emulator, but when run on the Device I get intermittent connectivity problems such as:
* The YouTube gdata video feeds can not be downloaded
* The YouTube gdata video feeds can be downloaded but the thumbnails fail to download
* When I try to play a video in the Device I get the following error: "The remote server returned an error: NotFound"
These problems come and go and other times the apps work perfectly on the Device. Again, this never happens on the Emulator. If I was running my Device tests over 3G/4G I'd be less surprised at this, but I am running the Emulator & Device over the exact same WiFi connection (router).
Has anybody else run into similar problems with their apps? The Device I'm using is a Lumia 521 and I am using the YouTube class from the AppStudio MyToolkit.Extended.dll package to play the YouTube videos.
Note, the error usually occurs during an async web request:
var request = (HttpWebRequest)WebRequest.Create(url);
var response = await Task.Factory.FromAsync<WebResponse>(request.BeginGetResponse, request.EndGetResponse, null);
But I trapped the error in the Debugger while the app was running on the Device, and I cut and paste the "url" it is requesting into my browser and it works fine. I'm beginning to wonder if this is some weird time-out problem. What's doubly weird, is that sometimes I get error messages on the feeds but they happen almost immediately instead of after the usual time length it takes a web request to time out.
Why does this only happen on the phone?