Why doesn't my audio play in the background? - windows-store-apps

I'm using this page to keep my audio playing across pages.
<Page
x:Class="MyApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:MyApp"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mmppf="using:Microsoft.PlayerFramework"
mc:Ignorable="d"
>
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<mmppf:MediaPlayer x:Name="player" AutoPlay="True" AudioCategory="BackgroundCapableMedia" />
<Frame x:Name="rootFrame"/>
</Grid>
</Page>
This is how my App Manifest looks.
But once I background my app, the audio stops playing.
From what I can see, everything mentioned here is present in my app
(the MediaPlayer element should take care of the SystemMediaTransportControls)

The page you're referring to is only applicable to Windows Store apps, not Windows Phone 8.1.
For Windows Phone 8.1, things seem more complicated, as you have to implement a background task, as explained here: Overview: Background audio (Windows Phone Store apps)

Related

Flash object not autoplaying (tumblr)

I have a flash object I need to embed on my tumblr blog (Billy's audio player) and the embed works fine, except that I need to click a white play button before the object works:
(this is in Chrome; there is a similar play button on Edge)
However, other websites don't have this play button over the widget, including the widget's own webpage and the bottom left of this blog.
This is the embed code, taken directly from the Billy's audio player webpage (with added newlines for readability):
<embed src="http://www.sheepproductions.com/billy/billy.swf?autoplay=true&f0=http://www.sheepproductions.com/sammy.mp3&t0=Sammy&total=1"
quality="high" wmode="transparent" width="200" height="10" name="billy"
align="middle" type="application/x-shockwave-flash" title="Adobe Flash Player">
Is there something I can add to make the flash object run automatically? I doubt it's a browser issue, as it works on some other webpages, and other viewers also see the white play button.
However, other websites don't have this play button... including the
widget's own webpage.
SWF and HTML must be in the same exact location (ie: web folder).
If SWF url is : http://www.sheepproductions.com/billy/billy.swf
then HTML must be : http://www.sheepproductions.com/billy/pageWithSWFembeded.html
This issue is caused by the small width/height of your SWF. Browsers assume it is a Flash advert banner and do not auto-load it. It can be fixed by either increasing SWF display size or by putting the small SWF in same location as HTML page that loads the SWF.
Also consider using HTML5 audio tag to guarantee playback of website audio even on mobile devices (they don't run Flash content within default browsers).

show global mediaelement to layoutroot?

I want to share MediaElement to play video among many pages (only 1 page will show video, others will play sound only).
<MediaElement x:Key="GlobalMedia" Visibility="Collapsed" AutoPlay="True" VerticalAlignment="Center"
Stretch="Uniform" /> // static media element in App.xaml
If I dont show video, everything works so fine. However, when I try to add this MediaElement to LayoutRoot: LayoutRoot.Children.Add(_media), I got InvalideOperationSystem exception (It told me that the mediaElement is already the child of another element). Does anyone has idea to show this global MediaElement to LayoutRoot? Thanks.

Windows media app works strange for me HTML CSS

I've a Windows Media Player box on me page, but...
The Windows Media Player will overlap every peace of html code how can I get it to the back and that I can still use it? And my second problem is that everybody that visit my page needed a plugin for loading it, but veryone has Windows Media Player installed on his PC? Who can help me and explain something :< Thanks already :D
<object id='mediaplayer' classid='clsid:6bf52a52-394a-11d3-b153-00c04f79faa6' type='application/x-oleobject' width='100%' height='150px'>
<param name='url' value='SONG.mp3'/>
<param name='autostart' value='1'/>
<param name='showcontrols' value='1'/>
<param name='stretchtofit' value='0'/>
<param name='enablecontextmenu' value='0'/>
<param name='ShowStatusBar' value='1'>
<embed src='SONG.mp3' width='100%' height='150px' autostart='1' type='application/x-
mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/'
transparentatstart='0' animationatstart='0' showcontrols='1' autosize='0' displaysize='0'
showtracker='0' ShowStatusBar='1'></embed>
The first part of your question is difficult to answer without some sample code to work with.
I would recommend added a presized container div to hold the player in your desired location on the page.
To answer the senond part of your question.
Embedding media player in your webpage means users will be executing the file through their web browser. A plugin for the users specific browser is required to play back the files.
This is standalone from windows media player and will allow users who do not have media player to play the files from their desired browser and operating system.
If you want people to use there installed media player then a link to download the file and execute it on their own computer is required.

forcing device orientation blackberry webworks bb10

i look for my html5 app is always in landscape, i read this Change the Screen Orientation in Blackberry? and Blackberry Force Screen orientation but the solutions are presented for java development on platforms oldest, the current blackberry 10. I want to js +html5
This is done in the config.xml file. Just add this...
<feature id="blackberry.app">
<param name="orientation" value="landscape" />
</feature>
For more information you can visit the BlackBerry developer site which has a lot of docs, samples, and getting started guides.
http://developer.blackberry.com/

SoundCloud HTML5 widget: share panel covers waveform when audio finished

When the audio completes in the HTML5 version of the SoundCloud widget, the share panel appears and covers the audio waveform. The user can replay the audio; however, the share panel doesn't disappear, nor does there seem to be any way for the user to hide it. Nor is there any way to prevent the panel from appearing in the first place, which is the ideal option.
The "sharing" parameter is set to false in my embed code.
Here is the embed code I'm using:
<iframe width="100%" height="100%" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F87283114&buying=false&sharing=false&liking=false&show_artwork=false&download=false&show_user=false&show_bpm=false&show_playcount=false&show_comments=false&color=568ED4&theme_color=DDD9C3"></iframe>
Replicated in Firefox and Chrome.
Again, this is an HTML5 issue only. The Flash version works properly.
Note that a similar issue also occurred but was fixed in the Flash version:
New SoundCloud HTML5 widget animation on track finish