Browse Source

Standardised on useing .m4v for this VideoPlayer demo. Should work across most devices.

CartBlanche 13 years ago
parent
commit
ae4213c67e

BIN
Samples/MacOS/VideoPlayer/Content/sintel_trailer.m4v


BIN
Samples/MacOS/VideoPlayer/Content/sintel_trailer.mp4


+ 6 - 8
Samples/MacOS/VideoPlayer/Game1.cs

@@ -12,7 +12,7 @@ using Microsoft.Xna.Framework.Input;
 using Microsoft.Xna.Framework.Media;
 using Microsoft.Xna.Framework.Media;
 using Microsoft.Xna.Framework.Storage;
 using Microsoft.Xna.Framework.Storage;
 
 
-namespace Microsoft.Xna.Samples.Draw2D
+namespace MonoGame.Samples.VideoPlayer
 {
 {
 	/// <summary>
 	/// <summary>
 	/// This is the main type for your game
 	/// This is the main type for your game
@@ -21,13 +21,11 @@ namespace Microsoft.Xna.Samples.Draw2D
 	{
 	{
 		GraphicsDeviceManager graphics;
 		GraphicsDeviceManager graphics;
 		SpriteBatch spriteBatch;		
 		SpriteBatch spriteBatch;		
-		Texture2D texture, ball;
+		
 		SpriteFont font;
 		SpriteFont font;
-		float size, rotation;
-		float clippingSize = 0.0f;
-		Color alphaColor = Color.White;
+		
 		Video video;
 		Video video;
-		VideoPlayer videoPlayer;
+		Microsoft.Xna.Framework.Media.VideoPlayer videoPlayer;
 		bool playVideo = false;
 		bool playVideo = false;
 		
 		
         public Game1 ()  
         public Game1 ()  
@@ -39,7 +37,7 @@ namespace Microsoft.Xna.Samples.Draw2D
 			graphics.PreferMultiSampling = true;
 			graphics.PreferMultiSampling = true;
 			graphics.IsFullScreen = true;	
 			graphics.IsFullScreen = true;	
 
 
-			graphics.SupportedOrientations = DisplayOrientation.Portrait | DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight | DisplayOrientation.PortraitUpsideDown;
+			graphics.SupportedOrientations = DisplayOrientation.LandscapeLeft | DisplayOrientation.LandscapeRight;
 		}
 		}
 		
 		
 		/// <summary>
 		/// <summary>
@@ -68,7 +66,7 @@ namespace Microsoft.Xna.Samples.Draw2D
 			font = Content.Load<SpriteFont> ("spriteFont1");
 			font = Content.Load<SpriteFont> ("spriteFont1");
 			
 			
 			video = Content.Load<Video> ("sintel_trailer");
 			video = Content.Load<Video> ("sintel_trailer");
-			videoPlayer = new VideoPlayer(this);
+			videoPlayer = new Microsoft.Xna.Framework.Media.VideoPlayer(this);
 			playVideo = true;
 			playVideo = true;
 		}
 		}
 
 

+ 4 - 2
Samples/MacOS/VideoPlayer/MonoGame.Samples.VideoPlayer.MacOS.csproj

@@ -10,7 +10,7 @@
     <OutputType>Exe</OutputType>
     <OutputType>Exe</OutputType>
     <RootNamespace>MonoGame.Samples.VideoPlayer</RootNamespace>
     <RootNamespace>MonoGame.Samples.VideoPlayer</RootNamespace>
     <AssemblyName>MonoGame.Samples.VideoPlayer.MacOS</AssemblyName>
     <AssemblyName>MonoGame.Samples.VideoPlayer.MacOS</AssemblyName>
-    <StartupObject>Microsoft.Xna.Samples.Draw2D.Program</StartupObject>
+    <StartupObject>MonoGame.Samples.VideoPlayer.Program</StartupObject>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <DebugSymbols>true</DebugSymbols>
     <DebugSymbols>true</DebugSymbols>
@@ -21,6 +21,7 @@
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <ConsolePause>false</ConsolePause>
+    <StartupObject>Microsoft.Xna.Samples.Draw2D.Program</StartupObject>
   </PropertyGroup>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>none</DebugType>
     <DebugType>none</DebugType>
@@ -29,6 +30,7 @@
     <ErrorReport>prompt</ErrorReport>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <WarningLevel>4</WarningLevel>
     <ConsolePause>false</ConsolePause>
     <ConsolePause>false</ConsolePause>
+    <StartupObject>Microsoft.Xna.Samples.Draw2D.Program</StartupObject>
   </PropertyGroup>
   </PropertyGroup>
   <ItemGroup>
   <ItemGroup>
     <Reference Include="System" />
     <Reference Include="System" />
@@ -55,7 +57,7 @@
     <Content Include="Content\spriteFont1.xnb">
     <Content Include="Content\spriteFont1.xnb">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
-    <Content Include="Content\sintel_trailer.mp4">
+    <Content Include="Content\sintel_trailer.m4v">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
     </Content>
   </ItemGroup>
   </ItemGroup>

+ 0 - 117
Samples/MacOS/VideoPlayer/MonoGame.Samples.VideoPlayer.csproj

@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{71192C89-7FB6-49A4-A19D-FC89E3D18248}</ProjectGuid>
-    <ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>MonoGame.Samples.Draw2D</RootNamespace>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchLink>None</MtouchLink>
-    <MtouchDebug>true</MtouchDebug>
-    <MtouchI18n />
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <AssemblyName>Draw2D</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
-    <DebugType>none</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\iPhoneSimulator\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchI18n />
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <AssemblyName>Draw2D</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhone\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchDebug>true</MtouchDebug>
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchI18n />
-    <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <AssemblyName>Draw2D</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\iPhone\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <MtouchI18n />
-    <CodesignKey>iPhone Developer</CodesignKey>
-    <MtouchSdkVersion>4.0</MtouchSdkVersion>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-    <AssemblyName>Draw2D</AssemblyName>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <WarningLevel>4</WarningLevel>
-    <AssemblyName>MonoGameSamplesDraw2D</AssemblyName>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <WarningLevel>4</WarningLevel>
-    <AssemblyName>MonoGameSamplesDraw2D</AssemblyName>
-    <MtouchUseArmv7>false</MtouchUseArmv7>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="System" />
-    <Reference Include="System.Xml" />
-    <Reference Include="System.Core" />
-    <Reference Include="monotouch" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Game1.cs" />
-    <Compile Include="main.cs" />
-    <Compile Include="FPSCounterComponent.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <Content Include="Content\purpleBall.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\SpriteFont1.xnb">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Default.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\monogameicon.png">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Content\1024.png" />
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-  <ItemGroup>
-    <None Include="monogameicon.png" />
-    <None Include="Info.plist" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\..\..\..\MonoGame\MonoGame.Framework\MonoGame.Framework.iOS.csproj">
-      <Project>{DB8508BB-9849-4CC2-BC0F-8EB5DACB3C47}</Project>
-      <Name>MonoGame.Framework.iOS</Name>
-    </ProjectReference>
-  </ItemGroup>
-</Project>

+ 1 - 1
Samples/MacOS/VideoPlayer/main.cs

@@ -1,7 +1,7 @@
 using MonoMac.AppKit;
 using MonoMac.AppKit;
 using MonoMac.Foundation;
 using MonoMac.Foundation;
 
 
-namespace Microsoft.Xna.Samples.Draw2D
+namespace MonoGame.Samples.VideoPlayer
 {
 {
 	class Program
 	class Program
 	{
 	{