MediaElement Windows Phone 8.1 does not play links to resources, for example http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm, but plays links. mp3. Windows 8 running all references. What's the problem? and how to fix it? the same code.
//only works in windows 8.1
<MediaElement x:Name="MediaElement"
Source="http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm"
AutoPlay="True" Margin="199,320,114,252" Width="100" Height="100"/>
//works in windows 8, and in windows phone 8.1
<MediaElement x:Name="MediaElement"
Source="http://radio02-cn03.akadostream.ru:8114/businessfm96.mp3"
AutoPlay="True" Margin="199,320,114,252" Width="100" Height="100"/>
If you subscribe to MediaElement.MediaFailed:
MediaElement.MediaFailed += MediaElement_MediaFailed;
then you will see that using the first link you get:
MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED : HRESULT - 0xC00D2EE0
which means (HRESULT) that:
0xC00D2EE0 NS_E_UNKNOWN_PROTOCOL
The specified protocol is not supported.
The list of supported audio and video formats you will find here.
from the c# set the string as uri
MediaElement.Source = new Uri("http://kgot-fm.akacast.akamaistream.net/7/449/31707/v1/auth.akacast.akamaistream.net/kgot-fm");
Related
I am developing an application for Android, iOS and Visual Studio using Xamarin
I added the following lines in xaml to use images:
<Image Source="header.png" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" />
<Button x:Name="Object_Detection" Image="header.png" />
The first is for displaying an image in the header and the second is for displaying a button icon. They link for the same image "header.png"
I put the image under:
- Mobile.Droid\Resources\drawable
- Mobile.iOS\Resources
-Mobile.Windows\Assets
But the image is not shown at all in the Windows 8.1 app.
the image size is 690*79.
how to resolve the problem?
You have to place images in the root Project directory for Windows Phone 8, Windows Phone 8.1 and UWP applications.
This guide will help you
http://developer.xamarin.com/guides/xamarin-forms/working-with/images
Try something like this :
<ContentPage.Resources>
<ResourceDictionary>
<OnPlatform x:Key="ImageHeaders"
x:TypeArguments="ImageSource"
iOS="header.png"
Android="header.png"
WinPhone="Assets/header.png" />
</ResourceDictionary>
</ContentPage.Resources>
<Image Source="{StaticResource ImageHeaders}" />
OR
<Image.Source>
<OnPlatform x:TypeArguments="ImageSource">
<OnPlatform.iOS><FileImageSource File="header.png"/></OnPlatform.iOS>
<OnPlatform.Android><FileImageSource File="header.png"/></OnPlatform.Android>
<OnPlatform.WinPhone><FileImageSource File="Assets/header.png"/></OnPlatform.WinPhone>
</OnPlatform>
</Image.Source>
Not tested, but it seems to work well.
Thanks for all your posts,
the solution was to add the image resource to the windows sub-project directly under the root.
The addition should be made using visual studio so that the image will be taken in consideration by the compiler.
I 'm developping a windows phone 8.1 application and I would like to make a view with the panorama control but Its impossible to find the control
I have the Pivot control but not the panorama, is the panorama control is available on windows phone 8.1 ?
I have find nothing on it on the Internet so far :/
Thanks for the help :)
The Panorama control has been renamed Hub because it’s now available on both Windows Phone and on Windows. So, you would do something like:
<Hub Header="My header">
<HubSection Header="My sub header">
<DataTemplate>
<Grid />
</DataTemplate>
</HubSection>
<HubSection Header="My sub header 2">
<DataTemplate>
<Grid />
</DataTemplate>
</HubSection>
There are some changes in the API, as you will use HubSection instead of a PanoramaItem, and you must have a DataTemplate inside a HubSection, so be sure to check the following reference:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.hub.aspx
There are some nuances as a slightly different and odd behaviour when you have only 2 HubSections, as noted here: Windows Phone 8.1 app with 2 hub sections, but that may or may not be an issue for you. Some guidelines and implementation examples can be found here:
https://msdn.microsoft.com/en-us/library/windows/apps/dn449149.aspx
I'm using C# and Windows Phone 8.1 (as Universal). I have a WebView using this code:
<WebView x:Name="webView"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ScrollViewer.ZoomMode="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
I load an HTML string or URI but when I scroll or tap on WebView it terminates my Application.
How do I resolve this?
A friend and I have tried to get the video player on Windows Phone 8.1 to play a m3u8 stream, but we've been unavailable to succeed.
What we've tried:
We've tried with playerframework.codeplex.com (Microsoft Player Framework), but it was unable to load the file.
We also tried with Windows Phone Streaming Media (https://phonesm.codeplex.com/), but we were unable to as much as use this one as we couldn't make sense of their documentation on how we actually had to load the file?
Is there anybody who have worked with this kind of files before? I understand that m3u8 is not natively supported by Windows Phone 8.1
Download the player framework, consume the following DLL's:
Add the player to your xaml:
xmlns:mmppf="using:Microsoft.PlayerFramework"
xmlns:smmedia="using:SM.Media.MediaPlayer"
<mmppf:MediaPlayer IsFullScreenVisible="True" IsFullScreenEnabled="True" IsFullScreen="False" CurrentStateChanged="mPlayer_CurrentStateChanged" x:Name="mPlayer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" IsFastForwardEnabled="False" IsInfoEnabled="False" IsLive="True" IsMoreEnabled="False" IsRewindEnabled="False" IsRightTapEnabled="False" IsScrubbingEnabled="False" IsSeekEnabled="False" IsSkipBackEnabled="False" IsSkipAheadEnabled="False" IsReplayEnabled="False" IsTimelineVisible="False" IsTimeElapsedVisible="False" IsTimeRemainingVisible="False" RequestedTheme="Dark">
<mmppf:MediaPlayer.Plugins>
<smmedia:StreamingMediaPlugin />
</mmppf:MediaPlayer.Plugins>
</mmppf:MediaPlayer>
Then set your stream VIA code - or XAML if the URL never changes.
#Mahesh Vemuri asked what if he has error that says StreamingMediaPlugin is not available or not found in namespace, here is my work around:
XAML:
xmlns:PlayerFramework="using:Microsoft.PlayerFramework"
<PlayerFramework:MediaPlayer Name="player"
Source="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
AudioCategory="BackgroundCapableMedia"
IsAudioSelectionVisible="True">
<PlayerFramework:MediaPlayer.Plugins>
</PlayerFramework:MediaPlayer.Plugins>
</PlayerFramework:MediaPlayer>
And in your .xaml.cs file you simply do this:
SM.Media.MediaPlayer.StreamingMediaPlugin asd = new SM.Media.MediaPlayer.StreamingMediaPlugin();
player.Plugins.Add(asd);
player.Source = new Uri("address-to-m3u8");
It worked for me since "default" way didn't. Hope it helps someone else, too.
you can add them from xaml or cs. First add reference.
XAML
xmlns:local="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
xmlns:smmedia="clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8"
<local:MediaPlayer Name="player"
HorizontalContentAlignment="Stretch"
AutoPlay="True"
Volume="0.7"
Source="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"
IsPlayPauseVisible="True">
<local:MediaPlayer.Plugins>
<smmedia:StreamingMediaPlugin />
</local:MediaPlayer.Plugins>
</local:MediaPlayer>
XAML & CS
xmlns:local="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
<local:MediaPlayer Name="player"
HorizontalContentAlignment="Stretch"
AutoPlay="True"
Volume="0.7"
IsPlayPauseVisible="True">
</local:MediaPlayer>
SM.Media.MediaPlayer.StreamingMediaPlugin asd = new SM.Media.MediaPlayer.StreamingMediaPlugin();
player.Plugins.Add(asd);
player.Source = new Uri("http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8");
I'm developing a windows phone 8 app. I'm new to windows phone 8 development.
I need to add placeholder for text box . I searched in Google & Stack Overflow i got one solution by using The windows phone Toolkit.
I try with following Code.
Step-1: Add Windows Phone Toolkit In Reference By Using Nuget gallery
Step-2: Add namespace in page header
xmlns:xtk="using:WinRTXamlToolkit.Controls"
Step-3: My Textbox XAML code
<TextBox Name="Usernametxt" Text="User Name"></TextBox>
<TextBox Name="Passwordtxt" Text="Password"></TextBox>
<TextBox Name="Emailtxt" Text="Eamail Address"></TextBox>
Step-4: I add the following code under the Usernametxt box [I don't know it's correct or not]
<xtk:WatermarkTextBox WatermarkText="some text" />
I got error in above line The Name WatermarkTextBox does not exist in namespace"using:WinRTXamlToolkit.controls"
I got this solution Here
I don't know how to use this property . I need to add placeholder for 4 to 5 textbox in same page.
Help me to solve this problem.
You are mixing up Windows Phone 8 and Windows 8.
You need a reference to correct toolkit
xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
And then you can
<toolkit:PhoneTextBox Hint="some text" Name="Usernametxt" />
Make sure you can got the right Nuget package, more details here.