How do I play custom audio for Toast notifications? - windows-phone-8

I can receive Toast notifications on my phone, but I can't seem to specify the audio it should play.
I've modified the toast XML to include a sound, e.g.
<?xml version="1.0" encoding="utf-8"?>
<wp:Notification xmlns:wp="WPNotification">
<wp:Toast>
<wp:Text1>TOAST TEXT</wp:Text1>
<wp:Text2>This is a toast</wp:Text2>
</wp:Toast>
<wp:Sound>myfile.mp3</wp:Sound>
</wp:Notification>
But this doesn't work.
What do I need to do to make it work?

Toast with sound works only on Windows Phone 8 Update 3 and later versions. Make sure the file you specified in your XML is stored in the proper location. Also make sure the sound file is less than 10 seconds long.
Windows Phone 8 Update 3 (OS version number 8.0.10492) introduces the
ability to provide a custom sound for toast notifications. Sound files
can be in WAV, WMA, or MP3 format, must be less than 10 seconds long,
and must be stored in the app’s installation directory or local
storage folder.
To use a custom sound for a toast that is launched via a cloud
service, all you need to do is include a Sound element in the XML
payload. To launch a silent toast, you can use the Silent attribute,
set to “true”.
See code samples here.

Related

Check end of transcoding for vimeo-api?

I need to be sure by an API request that the transcoding of an uploaded video is full ended and all possible renditions are available.
I know that that the API give responses in [body][status] about
available, uploading, transcoding, uploading_error, transcoding_error
but the problem is that the status changes from 'transcoding' to 'available' in the second when the first rendition is transcoded. So how can I check by an API-Request that vimeos work has full ended and no other rendition will be added to the video in the next minutes.
Thanks
If you are a PRO user and there is a specific size you are looking for you should wait for the file to appear in the files list. Waiting for "all" is not recommended because we are constantly changing and improving the list of files available.
If you are not a PRO user, this information is not exposed at all. Once the SD version is available you will be able to generate embed codes, and shortly after that your player will have the ability to switch into HD mode (once the HD file is available).

IsolatedStorageSettings after application update from store

I am writing my Windows Phone 8.1 Silverlight App (NOT RunTIME framework).
I have to questions:
Which is the App manifest file for Windows Phone 8.1 Silverlight? WMAppManifest or Package.appxmanifest? as my project contains both
I created a method in Mainpage of application which detects that is it the first time this application is running or not. If it is first time execution of this app, registry of 120 keys (IsolatedStorageSettings.ApplicationSettings) is created and app moves to WelcomePage.If the execution is not the firsttime, means user has opened this app before, it skips the registrycreation method and directly goes to homepage.
When I upload this version 1 of app to store and users install and use it. What when I add more keys to registrycreate method in version 2 and upload version 2 to store. How will be those new keys get created? Even, when user updates the app, the registrycreation method will never run.
The "Silverlight" app manifest is WMAppManifest.xml, but you still need to include the "RT" manifest Package.appxmanifest and, if you ever use any of the RT namespaces that require certain capabilities, you should check those capabilities in the Package.appxmanifest too. Eg "Internet (Client & Server)" if you are using things like Windows.Networking.BackgroundTransfer.
You'd need to add some code to check if the information or information structure has changed every time the app is run (or resumed), so that in the event of an update (and change in the keys), they get added, even if your "first run" code doesn't fire. Make sense?
If you know the keys numbers will always get bigger then watching the key count will work. You could also include a key with the version so you can tell which version the data was created with.
You can use Windows.Storage.ApplicationData instead of IsolatedStorageSettings in Windows Phone Silverlight 8.1. ApplicationData supports versioning with the ApplicationData.SetVersionAsync method so you can change the data format safely when you update the app.
Either way, when the app runs check if the data's version is the latest that the app knows about. If not then run your setup and migration code to add the new keys and replace the out-of-date ones.
The data version doesn't have to match the app version (you may update the app's version without changing the data). You can compile a data version constant into the app's data handling code and bump it whenever you change the data format.

WP8 toast notification with custom sound

I'm currenly writing an app where I need to use custom sound for toast notifications (which is sent from cloud). MSDN states that the audio clip must be stored in the app's installation directory or local storage folder. So how is this done?
I tried the CopyToIsolatedStorage() code sample from How to play background audio for Windows Phone. It fetches the audio clip correctly but when the toast should be shown the device won't play any audio or even show the toast which indicates that it can't find the audio clip correctly. In the app, I have a method which shows contents of the push notification when the app is in foreground. From there I can see that the toast notification is sent and received correctly with toast.mp3 sound tag. So the problem must be in the app but I can't figure out what I did wrong.
Tl;dr version:
I want to change toast notification sound, my device is running WP8 with Update 3 and I have a 5 sec long mp3. I can't figure out how and where I should put the audio clip.
I dont think you need to copy the sound to isolated storage, just put it in your main project and set it as content. Then in your Push just reference it.
<wp:Sound>toast.mp3</wp:Sound>
Or if it is in the Assets folder in your project do
<wp:Sound>Assets/toast.mp3</wp:Sound>
Note: This only works for Windows Phone 8 Update 3 and later, works fine for all Windows Phone 8.1.
So the problem was that I blindly assumed one can reference to the audio clip with just <wp:Sound>toast.mp3</wp:Sound> or new Uri("toast.mp3", UriKind.RelativeOrAbsolute), as in the MSDN tutorial, when the file is copied to the root of the isolated storage but this isn't the case. You'll have to include the directory where the clip is in your project to the path, in my case Audio\. Thaks goes to WiredPrairie for pointing this out.
So to wrap things up:
Copy the audio clip which you want to use to the isolated storage with CopyToIsolatedStorage() from How to play background audio for Windows Phone and follow the instructions in Using custom sounds in toasts on Windows Phone 8 Update 3 . And remember to include the directory structure to the path of the clip or put the clip in the root of your project.

How can I do simple streaming of a video file using Akamai?

I'm a C# developer completely new to Flash but am attempting to stream a file from Akamai's HD Network using their HD Flash 1.0 configuration.
I have "imported" the video already deployed on the Akamai network, but it seems there is a step where I have to somehow leverage an SWC component to actually make the connection to Akamai work properly.
The docs provided are all using what appears to be a much older version of Flash and don't include an FLA file. However, part of their docs do make it sound trivial to someone more versed in Flash:
Akamai HDNetwork v1.0 - HTTP delivery of FLV files, compatible with
Flash player 10.0 (we call it HDN1 for short) - combine a base NetConnection connected to "null" with a com.akamai.hd.HDNetStream. Follow the samples inside the samples\HDN1.0 folder to find out how to do basic live playback, basic VOD, multi-bitrate
playback, manual switching, sub-clips, and token authentication.
And also:
com.akamai.hd.HDNetStream— is used for HD Flash 1.0 Streaming
I placed the SWC file in the same folder as the FLA I'm working in, and included this code in the Actions window:
import flash.net.NetConnection;
import com.akamai.hd.HDEvent;
import com.akamai.hd.HDNetStream;
trace("Hi!");
// Magic happens here
.. but I just get compilation errors that the import definitions can't be found. So...not off to a good start.
All I want to do is stream the video - no multi-bitrate configurations or anything crazy - just how to get videos playing using our own SWF files. Does anyone know the easiest way to get up and running with this?

Adobe Air - Open app in fullscreen

I created an Air desktop app with Flash CS 5. Usually Windows (XP) is opening an application (like Firefox) with the latest set size and position.
For my installed Air app it's always just the default one.
How to start it with the latest used size and position?
Thanks.
Uli
hope this will work for you:
http://cookbooks.adobe.com/post_Using_the_FullScreen_functionality_in_AIR-8004.html
http://blog.ochodurando.com/2010/04/adobe-air-e-fullscreen/
You need to save a record somewhere that remembers the window's size, and possibly position. If your app has a preferences file, this would be an ideal place to store that information. Then, whenever your app starts, it checks for this information and resizes the window if any values are found.
Most popular programs include this feature (and don't even mention it, since it's pretty basic UI), but it's done intentionally and not as a default for every application. Thus if you want it, you have to program it in.
You can read and write to application.xml. You'll find there and nodes.
file = new File( File.applicationDirectory.nativePath + "/META-INF/AIR/application.xml" );
Adobe restrict writing access to application diractory but this trick is useful if you don't want to create a separate config file in app-storage:/ folder, which is of course prefered.