I'm doing some tests with the Smooth Streaming Client SDK for Windows 8, and I have a very basic application playing a fullscreen video:
private MediaExtensionManager extensions = new MediaExtensionManager();
public MainPage()
{
this.InitializeComponent();
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "text/xml");
extensions.RegisterByteStreamHandler("Microsoft.Media.AdaptiveStreaming.SmoothByteStreamHandler", ".ism", "application/vnd.ms-sstr+xml");
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string url = "http://my.smooth.streaming.url/manifest";
this.slPlayer.Source = new Uri(url);
this.slPlayer.Play();
}
This seems to be working fine, unless I plug my headphones, at which point the application stops working. Adding a handler for the MediaFailed event informs I'm getting a MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED error.
Any idea what may be causing this?
Badaro, I just tried this and was not able to repro the problem (on both x86 & x64, both starting with and without headphones and switching during playback). My guess is that you are either:
1) running into a driver issue.
2) there is something specific about the way your stream is encoded that causes this.
I suggest ruling out #1 by trying on a few different machines.
or, rule out #2 by trying the sample smooth SDK stream: http://mediadl.microsoft.com/mediadl/iisnet/smoothmedia/Experience/BigBuckBunny_720p.ism/Manifest
Related
I had created the WCF service for file uploading. Its working fine when the service hits from web application or from IOS device. But its throwing an exception when it comes from Android device.
I tried to multiparse the streamdata. Its throwing an exception as like file unavailable.
public OASIS.Entity.Shared.UserFileUpload FileUpload(Stream data, string UploadMode)
{
OASIS.Entity.Shared.UserFileUpload userFileUpload = new Entity.Shared.UserFileUpload();
try
{
MultipartParser parser = new MultipartParser(data);
string fileName = string.Empty;
string filePath = string.Empty;
string allowedExtensions = string.Empty;
int allowedFileSizeMB = 0;
if (parser.FileAvailable)
{
// File Available for IOS / Web application.
// userFileUpload
}
else
{
// From android device file is getting not available.
}
}
catch (Exception exp)
{
OASIS.Utility.ExceptionManager.HandleException(exp);
userFileUpload = null;
}
return userFileUpload;
}
Expecting it should get work for android device too.
By default, WCF does not support form data files, so it looks like you are using MultipartParser to convert form data (data from a file stream uploaded through a form-data).
If this class can handle data submitted in IOS, it should also be able to handle data submitted through forms in Andriod, after all, the HTTP protocol is cross-platform.
thereby I would like to know, how do you upload data in the Andriod system?
By adding breakpoint debugging, can you use this class to parse form data properly?
I suggest you handle the form-data by creating the service with asp.net WebAPI.
https://learn.microsoft.com/en-us/aspnet/web-api/overview/advanced/sending-html-form-data-part-2
Feel free to let me know if there is anything I can help with.
Background:
I have a class which extends from AccessibilityService. Whenever a window is changed following function is called which gives me the application name of the foreground application.
#Override
public void onAccessibilityEvent(AccessibilityEvent event) {
}
Following is the configuration I set:
#Override
protected void onServiceConnected() {
super.onServiceConnected();
//Configure these here for compatibility with API 13 and below.
AccessibilityServiceInfo config = new AccessibilityServiceInfo();
config.eventTypes = AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
config.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
if (Build.VERSION.SDK_INT >= 16) { //Just in case this helps
config.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
}
setServiceInfo(config);
}
AccessibilityService.xml
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service
xmlns:android="http://schemas.android.com/apk/res/android"
android:description="#string/accessibility_explanation"
android:accessibilityEventTypes="typeWindowStateChanged|typeAllMask"
android:accessibilityFeedbackType="feedbackSpoken|feedbackHaptic|feedbackAudible|feedbackVisual|feedbackGeneric|feedbackAllMask"
android:notificationTimeout="100" android:canRetrieveWindowContent="true" />
The Problem:
It works fine for some time, but after a day or two it suddenly stops working. It doesn't call the onAccessibilityEvent(AccessibilityEvent event) function. Although the accessibility service of this application is enabled but still it doesn't show the application name when window is changed.
May be it doesn't work if the application comes back from sleep mode? I had to reinstall the application on top of my debug build and then again it started working but for how long.
Question: How can I make sure it always return me the application name when window is changed?
Just restart your app. This is because Accessibility Service is managed by the Android OS, so if any thing causes your service to crash, it will be killed and rescheduled to be started at some time in the fture that you can not control. So it is possible that your service has been killed.
I'm trying to monetize my app with Universal Windows. I followed the official tutorials but when I tried to load an interstitial ad, always I'm getting this errors:
Interstitial ad is not ready. With this error code: ClientConfiguration.
Failed to make http requestError. With this error code: NetworkConnectionFailure.
I don't know what I am missing.
This is my code:
public sealed partial class Myclass: Page {
InterstitialAd MyVideoAd;
public MyClass() {
this.InitializeComponent();
var MyAppId = "d25517cb-12d4-4699-8bdc-52040c712cab";
var MyAdUnitId = "11389925";
MyVideoAd = new InterstitialAd();
MyVideoAd.ErrorOccurred += MyVideoAd_ErrorOccurred;
MyVideoAd.RequestAd(AdType.Video, MyAppId, MyAdUnitId);
}
private void MyVideoAd_ErrorOccurred(object sender, AdErrorEventArgs e) {
String errrorMessage = e.ErrorMessage;
String errorCode = e.ErrorCode;
}
private void showInterstitial(object sender, TappedRoutedEventArgs e) {
MyVideoAd.Show();
}
}
When I execute the application, a few seconds after the MyVideoAd_ErrorOccurred method is launched with the values of errorMessage and errorCode as I've said. That happens on my Windows 10 mobile device and in the Desktop machine execution. The codes of adUnit and application id are the provided in the Microsoft page for tests.
I hope that you can help me.
For UWP app, please install Microsoft Universal Ad Client SDK and use AdMediatorControl.
References:
Install the Universal Ad Client SDK
Add and use the ad mediator control
Check my sample: https://github.com/Myfreedom614/UWP-Samples/tree/master/AdClientUWPApp
Be sure to have these 3 Capabilities defined inside your manifest:
<Capabilities>
...
<Capability Name="internetClient"/>
<Capability Name="internetClientServer"/>
<Capability Name="privateNetworkClientServer"/>
...
</Capabilities>
The video hasn't finished loading. you need to give it enough time for that. also you need to make sure it is loaded before calling it with.
if ((InterstitialAdState.Ready) == (MyVideoAd.State))
{
MyVideoAd.Show();
}
I have a small console application doing some persistence with Raven which is working fine, but I just can't get the Raven Studio Web-App working.
I think I have read every article/blog post on the web which is around, but I haven't got it working.
The project is referencing the Raven.Client.Embedded, Raven.Client.Lightweight and Raven.Storage.Esent assemblies)
Here is the really simple code starting up my console app:
class Program
{
static void Main(string[] args)
{
EmbeddableDocumentStore store = new EmbeddableDocumentStore { DataDirectory = #"C:\temp\ravendata", UseEmbeddedHttpServer = true };
store.Initialize();
Console.WriteLine("Initialized");
while (true)
{
string line = Console.ReadLine();
if (line == "w")
{
Changeset cs = CreateChangeset();
using (var session = store.OpenSession())
{
session.Store(cs);
session.SaveChanges();
}
Console.WriteLine("Written.");
}
}
The question is: Where to put the Raven.Studio.xap in order to get it running in the browser (http://localhost:8080/Raven/studio.html)?
It's not working in the bin/debug output folder of my console app (which would be the most logical area where it should be), as well as it isn't if I put it in the root of my console application.
Sorry to ask this thing again, but it seems there is some point I am missing on this to get it up and running. ;)
Thanks for your help, R's, Rene
You are right, I've tried it using a new console application project and had the same issues, altough I copied the file Raven.Studio.xap into the \bin\debug AFTER I had seen the error message for the first time.
I found out, that the reason for this has to do with browser-caching. Even though the file would be available now, the embedded http-server returns 304 Not Modified, because it had sent the If-None-Match header into the request. Therefore, the cached "not-found" page in the browser cache will be used.
I fixed it and sent a patch to Ayende. However the solution now is:
1) make sure Raven.Studio.xap is under \bin\debug
2) clear the browsers cache
I am trying to do automation testing over a blackberry application written using J2ME over MIDlet architecture.
I have an application already running on blackberry devices. I am writing my TestApp (written again in J2ME) over existing App. (i.e., my TestApp extends to already Original App and it runs - inheriting).
I am trying to run the OriginalApp through my TestApp and handle the controls automatically using my TestApp. I am not able to automate the key strokes although I have already got the key codes of the blackberry device.
Keycodes I am using are like
KEY_BB_FIRE = -1204;
KEY_BB_UP = -1200;
KEY_BB_DOWN = -1201;
KEY_BB_LEFT = -1202;
KEY_BB_RIGHT = -1203;
I am trying to use _keyPressed and _keyReleased methods of Screen class.
boolean sendKeys(Form obj, int keyObj){
try{
obj._keyPressed(keyObj);
obj._keyReleased(keyObj);
}
catch (Exception e){
System.out.println("ERROR: Striking key in Form failed: "+keyObj);
return false;
}
return true;
}
Similarly I have got the key codes for Nokia device and I have completed automating the same application for Nokia. Just having trouble using the same technique on a blackberry.