Problems compile project

Jan 28, 2014 at 8:09 PM
Hi,
I have a problem when I try to compile the Project of example of Windows Phone 8. The error send me:
Error 5 El nombre "LocalizedStrings" no existe en el espacio de nombres "clr-namespace:SamplePlayer.WP8". C:\Users*\Desktop\phonesm-20130921\SamplePlayer\SamplePlayer.WP8\App.xaml 1 1 SamplePlayer.WP8
Error 2 El nombre "MediaPlayer" no existe en el espacio de nombres "clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework". C:\Users*\Desktop\phonesm-20130921\SamplePlayer\SamplePlayer.WP8\MainPage.xaml 21 9 SamplePlayer.WP8
Error 3 El nombre "MediaPlayer" no existe en el espacio de nombres "clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework". C:\Users*\Desktop\phonesm-20130921\SamplePlayer\SamplePlayer.WP8\MainPage.xaml 22 13 SamplePlayer.WP8
Error 4 El nombre "StreamingMediaPlugin" no existe en el espacio de nombres "clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8". C:\Users*\Desktop\phonesm-20130921\SamplePlayer\SamplePlayer.WP8\MainPage.xaml 23 17 SamplePlayer.WP8
Error 6 No se encontró el SDK "Microsoft.PlayerFramework.WP8.Core, Version=1.8.1.0". SM.Media.MediaPlayer.WP8
Error 7 No se encontró el SDK "Microsoft.PlayerFramework.WP8.Core, Version=1.8.1.0". SamplePlayer.WP8
Advertencia 1 No se encuentra el archivo primario 'MainPage.xaml' para el archivo '..\HlsView\MainPage.xaml.cs' en el proyecto. HlsView.WP8
Advertencia 9 No se pudo encontrar el componente 'Microsoft Player Framework' al que se hace referencia. SamplePlayer.WP8
Advertencia 8 No se pudo encontrar el componente 'Microsoft Player Framework (Microsoft.PlayerFramework.WP8.Core, Version=1.8.1.0)' al que se hace referencia. SM.Media.MediaPlayer.WP8
How can I solve those problems? I am novel with this type of projects.
Jan 28, 2014 at 8:16 PM
The problema is the reference of Microsft PlayerFramework.
Thank you
Coordinator
Jan 28, 2014 at 11:12 PM
I don't recall the version of Player Framework that was current when phonesm-20130921 was built. I build the current source with Player Framework 1.3.2. I don't think there should be any problem changing the references to whatever version of Player Framework you prefer (if you need to).

There have been a number of fixes related to the Player Framework plugin since that build and I'm working on getting another build together. I had hoped to get that together by this weekend, but there are still a couple of things I'm trying to sort out.

If you are using SamplePlayer.WP8 and you have Visual Studio Pro or better (or don't mind converting the PCLs into normal assemblies), I would suggest you try a build against the current source instead of phonesm-2030921.
Jan 29, 2014 at 9:13 PM
Hi henric,
thank you by your fast answer. The last problem was the reference with the new Microsoft player versión. I could resolve it without problem when I found the problem. Now, I try with your last Release and the source code but I have a new same problem in both. I need to use the example that is called "SamplePlayer.WP8" And the error is the line "<smmedia:StreamingMediaPlugin />" of MainPage.xaml.
It says "El nombre "StreamingMediaPlugin" no existe en el espacio de nombres "clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8"."
And Again, Thank you by your help.
Coordinator
Jan 29, 2014 at 11:25 PM
Could you post a copy of the text in the "Output" window for your build (Debug -> Windows -> Output, then select the "Build" drop down)? There should hopefully be some useful information there.
Jan 30, 2014 at 2:25 AM
I'm actually in a similar situation - trying to compile the latest source and using PlayerFramework 1.3.2. I'm using VS2012 Express for phone (which is currently the latest Express version, as MS has not updated the Express version). The SM.Media project does not load as it appears to target VS2013, and the project type is incompatible. Most of the other projects appear to target 'older' versions of VS, and consequently load just fine... but SM.Media doesn't, and is obviously critical.
@ any rate, I'm certainly looking forward to another build - I'm trying to make use of some of the features and fixes you've added since the September build.

Build issues notwithstanding, this is a great project - thanks for all your hard work :-)
Coordinator
Jan 30, 2014 at 8:02 AM
Edited Jan 30, 2014 at 8:04 AM
You're welcome.

I think the problem you are seeing is that Portable Class Library (PCL) projects will not load in "Express" editions of Visual Studio. When working with this stuff, I usually have it open in both VS2012 Pro and VS2013 Pro

If you don't mind hacking .csproj files, then you can convert them to normal projects that only target one architecture. The simplest way to do so is probably to create a new empty project that targets the platform you are interested in, then use a text editor to copy the list of files from the <ItemGroup> with <Compile> nodes in the SM.Media.Legacy.csproj file over the same section of your new project file. That is, copy this bit:
  <ItemGroup>
    <Compile Include="..\..\Global\GlobalAssemblyInfo.cs">
      <Link>Properties\GlobalAssemblyInfo.cs</Link>
    </Compile>
    <Compile Include="..\..\Global\SM.MediaVersion.cs">
      <Link>Properties\SM.MediaVersion.cs</Link>
    </Compile>
    <Compile Include="..\SM.Media\AAC\AacAudioSpecificConfig.cs">
      <Link>AAC\AacAudioSpecificConfig.cs</Link>
    </Compile>
...
    <Compile Include="..\SM.Media\Web\HttpClients.cs">
      <Link>Web\HttpClients.cs</Link>
    </Compile>
    <Compile Include="..\SM.Media\Web\IHttpClients.cs">
      <Link>Web\IHttpClients.cs</Link>
    </Compile>
    <Compile Include="Utility\SingleUseTaskTimer.cs" />
  </ItemGroup>
The links are relative, so the new project's directory needs to be in the Libraries directory (the same directory that contains the SM.Media directory).

You will need to do this to create platform-specific versions of both SM.Media and SM.TsParser. The custom SM.Media project will need to add a reference to the custom SM.TsParser as well as NuGet's Microsoft.Net.Http (which should pull in Microsoft.Bcl and Microsoft.Bcl.Build as well). TPL/async compatibility for older platforms (e.g., WP7) requires NuGet's Microsoft.Bcl.Async, since this moves some of the TPL into TaskEx, I added a Utiilty\TaskEx.cs file for non-legacy projects (e.g., WP8) that do not use Microsoft.Bcl.Async so that the rest of the code doesn't get littered with stuff like #if PHONE7 Task.Blah() #else Task.Blah() #endif. (Note that you should use NuGet to add those references; copying the packages.config file and the relevant sections in the .csproj file would result in the wrong assemblies being referenced.) There are some preprocessor definitions that may be needed as well; look for the "<DefineConstants>" node in the .csproj file.

I think that was everything needed to get the projects to compile. I haven't done so since I first added the Win8.1 project and the above is what I recall from doing so.

Note that the reason there are .Legacy variants of the projects is that VS2013 refuses to load anything with WP7 support and VS2012 refuses to load anything with Win8.1 support, so one project can't support both.

Alternately, you should be able to build with the 90-day free trial of VS2013 Pro.

I'm still trying to get a new build out. I've managed to cut down on much of the duplicated setup code and I've made it simpler to support raw streams (i.e., you can now feed it a .aac, .mp3, or .ts URL and it should play without changing the code to instantiate a SimpleSegmentManager instead of a PlaylistSegmentManager). While mucking with that code anyway, I had it look at the Content-Type headers if it couldn't figure out the stream type from the URL. This gets some internet radio stations to "just work".

This cleans up the code significantly and makes it more capable, but for the moment is still has a tendency to occasionally exhibit some undesirable behavior (e.g., throwing exceptions instead of playing). I'll push the changes to codeplex when I get things working again; hopefully within the next few days.
Coordinator
Jan 30, 2014 at 11:09 AM
Come to think of it, once I get the stuff I'm working on checked in, I could upload something along the lines of a weekly build (containing only a couple .dll files and without any particular testing). I have few other things I want to fix, a bunch of manual work to create a PCL-free download, and then some testing before publishing the next build; a quick, "at your own risk/some assembly required," build could be done in 20 minutes. Would that be of any interest?

BTW, does anyone know if PCLs can be built from the command line with the tools in VS Express? What happens if you try "msbuild SM.TsParser.csproj"?

Microsoft could be plugging their Visual Studio Online service through CodePlex by providing CI servers and the like for the projects that want them...
Jan 31, 2014 at 12:18 AM
Interesting, it turns out that building the PCL's from the command line in VS2012 Express (Phone) works just fine, so I can generate my own binaries now. Thanks :-)
Jan 31, 2014 at 8:43 AM
Hi Henric,
the information from output is the next:
1>------ Operación Compilar iniciada: proyecto: tvonline, configuración: Debug ARM ------
2>------ Operación Compilar iniciada: proyecto: SM.Media.MediaPlayer.WP8, configuración: Debug x86 ------
1>C:\Users\Jesusin\Documents\Visual Studio 2013\Projects\tvonline\tvonline\MainPage.xaml.cs(81,30,81,31): warning CS0168: La variable 'e' se ha declarado pero nunca se utiliza
1>C:\Users\Jesusin\Documents\Visual Studio 2013\Projects\tvonline\tvonline\MainPage.xaml.cs(147,34,147,36): warning CS0168: La variable 'e3' se ha declarado pero nunca se utiliza
1>C:\Users\Jesusin\Documents\Visual Studio 2013\Projects\tvonline\tvonline\ScheduledAgent.cs(73,30,73,32): warning CS0168: La variable 'e2' se ha declarado pero nunca se utiliza
1> tvonline -> C:\Users\Jesusin\Documents\Visual Studio 2013\Projects\tvonline\tvonline\Bin\ARM\Debug\tvonline.dll
1>C:\Users\Jesusin\Documents\Visual Studio 2013\Projects\tvonline\tvonline\Reproductor2.xaml(22,18,22,18): error : The tag 'StreamingMediaPlugin' does not exist in XML namespace 'clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8'.
2> Restoring NuGet packages...
2> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
2> All packages listed in packages.config are already installed.
2> SM.Media.MediaPlayer.WP8 -> C:\Users\Jesusin\Desktop\phonesm-20130921\SamplePlayer\SM.Media.MediaPlayer.WP8\Bin\x86\Debug\SM.Media.MediaPlayer.WP8.dll
========== Compilar: 1 correctos, 1 incorrectos, 0 actualizados, 0 omitidos ==========
And the code of file "Reproductor2" is:
<phone:PhoneApplicationPage
    x:Class="tvonline.Reproductor2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mmppf="clr-namespace:Microsoft.PlayerFramework;assembly=Microsoft.PlayerFramework"
    xmlns:smmedia="clr-namespace:SM.Media.MediaPlayer;assembly=SM.Media.MediaPlayer.WP8"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Landscape" Orientation="Landscape"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot es la cuadrícula raíz donde se coloca todo el contenido de la página-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <mmppf:MediaPlayer Source="http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8">
            <mmppf:MediaPlayer.Plugins>
                <smmedia:StreamingMediaPlugin />
            </mmppf:MediaPlayer.Plugins>
        </mmppf:MediaPlayer>
    </Grid>

</phone:PhoneApplicationPage>
What do you think what the problem is? And Sorry by my level of English.
Thank you again
Coordinator
Jan 31, 2014 at 11:47 AM
Bring up "Build" -> "Configuration Manager" and take a look at your "Active Solution platform" and the platform for both your app and for SM.Media.MediaPlayer.WP8. The build output suggests you are building for Debug/ARM (for debugging on an actual device) and your app is using that configuration, but SM.Media.MediaPlayer.WP8 seems to be set for Debug/x86 (for debugging on an emulator). I think that if you change SM.Media.MediaPlayer.WP8's Platform drop-down from x86 to ARM it should work better.

Make sure the "Build" checkboxes are checked for the projects you are trying to build (and don't forget to check the same things for the Release solution configuration).
Coordinator
Jan 31, 2014 at 11:55 AM
voros1 wrote:
Interesting, it turns out that building the PCL's from the command line in VS2012 Express (Phone) works just fine, so I can generate my own binaries now. Thanks :-)
You're welcome.

...good to know that the Express folks can still build PCLs.

It does lead to another question: Does it work, now that you have assemblies?

You might want to take a look at how the .dll references are set up in the phonesm-*.zip .csproj files. If you put the configuration and/or platform in the path, it will pick the release or debug version as needed. The GUI doesn't let you edit them that way, but it is quite happy to use them.
    <Reference Include="SM.Media.Platform.WP8">
      <HintPath>..\..\bin\$(Configuration)\WP8\$(Platform)\SM.Media.Platform.WP8.dll</HintPath>
    </Reference>
Feb 1, 2014 at 9:33 AM
Hi henric,
I set it as you say me but It continues saying the same error. I can't understand what causes it. Any Ideas?
Thank you again
Coordinator
Feb 1, 2014 at 2:15 PM
I think the error is from your tvonline project not being able to load the assembly SM.Media.MediaPlayer.WP8. Have you added a reference from tvonline to SM.Media.MediaPlayer.WP8? If you look tvonline's output directory (likely bin/ARM/Debug), do you see SM.Media.MediaPlayer.WP8.dll?

if you add this in one of tvonline's .cs files,
    var x = new SM.Media.MediaPlayer.StreamingMediaPlugin();
does the build complain?
Feb 1, 2014 at 4:55 PM
It does lead to another question: Does it work, now that you have assemblies?
Yes, the solution just needed to be built piecemeal... but once that happened, video loads and plays just fine.
Coordinator
Feb 1, 2014 at 8:11 PM
voros1 wrote:
It does lead to another question: Does it work, now that you have assemblies?
Yes, the solution just needed to be built piecemeal... but once that happened, video loads and plays just fine.
Does VS Express let you add a "Pre-Build Event Command Line" in your project's "Build Events" settings? If so, you should be able to call msbuild.exe on the PCL projects.

Good to know that it is working for you. Keep an eye out for more checkins for the next week or so. While all the recent changes did clean up many things, those changes may also have introduced some, "non-optimal behavior." (What? Bugs in my code? Never...)
Feb 12, 2014 at 8:45 AM
henric wrote:
I think the error is from your tvonline project not being able to load the assembly SM.Media.MediaPlayer.WP8. Have you added a reference from tvonline to SM.Media.MediaPlayer.WP8? If you look tvonline's output directory (likely bin/ARM/Debug), do you see SM.Media.MediaPlayer.WP8.dll?

if you add this in one of tvonline's .cs files,
    var x = new SM.Media.MediaPlayer.StreamingMediaPlugin();
does the build complain?
Hi Henric,
I haven't answered before, because I haven't had enough time. If I write the line that you said, it is compiled correctly. I have detected a patrón of the problem. If tvonline.xaml is opened, it can't compile. In the other case, it is compiled correctly.
I have got one question more. I'm doing the versión of W8/RT of app too, so. will you do the plugin for Media PlayerFrameWork? I ask you this question in order to implement a similar versión of player of your sample or I wait until you publish the plugin.
Thank you again by your library and your help
Coordinator
Feb 12, 2014 at 8:00 PM
Could you try removing the
   <smmedia:StreamingMediaPlugin />
from the XAML, give the MediaPlayer element a name, and then programmatically add a,
    new SM.Media.MediaPlayer.StreamingMediaPlugin();
in your page's constructor?

Are there any linker warnings about Microsoft.Bcl.Build in your build output? You may need to do a "Rebuild Solution" to see them?

As for Win8.1: I have taken a look and the Player Framework plugin architecture is a bit different on that platform. I don't think it would be too much work to implement something like StreamingMediaPlugin, but right now I'm in the middle of trying to clean up TsMediaManager and sort out some issues with configuration and object lifecycle management. That is just the sort of thing that screams "DI container." However, that has forced a general cleanup of how stuff is intialized as well as discovering that Ninject doesn't really like Win8.1 and Autofac isn't all that happy about WP7. And while Autofoac is fine for desktop/browser Silverlight, it can't share the same PCL assembly as WP8 and Win8.1 since the PCL profiles don't line up. On the bright side, stream detection through both file extension and MIME type works better and .ac3 streams can now be played on Win8.1 (AC3 and H.262 already worked as part of .ts streams). That means .m3u8, .m3u, .pls, ..aac, .ac3, .mp3, and .ts streams should work as long as either the URL has the right file extension or the server returns a reasonable Content-Type (and, of course, the platform must support the actual CODEC;, so H.262 and AC3 only work on Win8.1). ...the short version: yes, I'm looking at PF for Win8.1, but I need to finish some other stuff first.
Feb 25, 2014 at 8:23 PM
henric wrote:
Could you try removing the
   <smmedia:StreamingMediaPlugin />
from the XAML, give the MediaPlayer element a name, and then programmatically add a,
    new SM.Media.MediaPlayer.StreamingMediaPlugin();
in your page's constructor?

Are there any linker warnings about Microsoft.Bcl.Build in your build output? You may need to do a "Rebuild Solution" to see them?

As for Win8.1: I have taken a look and the Player Framework plugin architecture is a bit different on that platform. I don't think it would be too much work to implement something like StreamingMediaPlugin, but right now I'm in the middle of trying to clean up TsMediaManager and sort out some issues with configuration and object lifecycle management. That is just the sort of thing that screams "DI container." However, that has forced a general cleanup of how stuff is intialized as well as discovering that Ninject doesn't really like Win8.1 and Autofac isn't all that happy about WP7. And while Autofoac is fine for desktop/browser Silverlight, it can't share the same PCL assembly as WP8 and Win8.1 since the PCL profiles don't line up. On the bright side, stream detection through both file extension and MIME type works better and .ac3 streams can now be played on Win8.1 (AC3 and H.262 already worked as part of .ts streams). That means .m3u8, .m3u, .pls, ..aac, .ac3, .mp3, and .ts streams should work as long as either the URL has the right file extension or the server returns a reasonable Content-Type (and, of course, the platform must support the actual CODEC;, so H.262 and AC3 only work on Win8.1). ...the short version: yes, I'm looking at PF for Win8.1, but I need to finish some other stuff first.
Hi again,
I haven' got problem from BCL.Build.... but this problem is minor. With the trick that I said before I can finish the App. Respect to Win8.1, I have implement a variation of your example player and I like as it work. (sorry by mi level of English) When I have tried to upload the App in the dev center, I have received one error. Have ever you got someone? In my case, I have received this:
"2001: There are duplicate files in AppManifest.xml. Remove one of the files and then try again."
And the repeated line is:
""<AssemblyPart x:Name="Microsoft.PlayerFramework" Source="Microsoft.PlayerFramework.dll" />""
Thank you again
Coordinator
Feb 26, 2014 at 6:34 AM
No, I hadn't seen that before, but I SamplePlayer.WP8 has the same problem when I build it. As a work-around, I think you can open the xap (as a .zip file), edit the file to remove the extra line, and then I think it should work.

The PlayerFramework assembly is referenced twice (directly in SamplePlayer.WP8 and in SM.Media.MediaPlayer.WP8). Both appear as SDKReference, like so:
    <SDKReference Include="Microsoft.PlayerFramework.WP8.Core, Version=1.8.2.2">
      <Name>Microsoft Player Framework</Name>
    </SDKReference>
This is what SamplePlayer.WP8_Release_ARM.xap's AppManifest.xaml looks like when I build it:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="SamplePlayer.WP8" EntryPointType="SamplePlayer.WP8.App" RuntimeVersion="4.7.50308.0">
  <Deployment.Parts>
    <AssemblyPart x:Name="SamplePlayer.WP8" Source="SamplePlayer.WP8.dll" />
    <AssemblyPart x:Name="Microsoft.PlayerFramework" Source="Microsoft.PlayerFramework.dll" />
    <AssemblyPart x:Name="SM.Media" Source="SM.Media.dll" />
    <AssemblyPart x:Name="SM.Media.MediaPlayer.WP8" Source="SM.Media.MediaPlayer.WP8.dll" />
    <AssemblyPart x:Name="SM.Media.Platform.WP8" Source="SM.Media.Platform.WP8.dll" />
    <AssemblyPart x:Name="System.Net.Http" Source="System.Net.Http.dll" />
    <AssemblyPart x:Name="System.Net.Http.Extensions" Source="System.Net.Http.Extensions.dll" />
    <AssemblyPart x:Name="System.Net.Http.Primitives" Source="System.Net.Http.Primitives.dll" />
    <AssemblyPart x:Name="Microsoft.PlayerFramework" Source="Microsoft.PlayerFramework.dll" />
    <AssemblyPart x:Name="SM.Media.Builder" Source="SM.Media.Builder.dll" />
    <AssemblyPart x:Name="Autofac" Source="Autofac.dll" />
    <AssemblyPart x:Name="SM.TsParser" Source="SM.TsParser.dll" />
  </Deployment.Parts>
</Deployment>
Does anyone else have any experience with this?
Coordinator
Feb 26, 2014 at 6:36 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.