From: <gre...@us...> - 2007-04-17 17:00:42
|
Revision: 338 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=338&view=rev Author: gregmac45 Date: 2007-04-17 10:00:41 -0700 (Tue, 17 Apr 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos.sln trunk/plugins/OnlineVideos/Source/OnlineVideos.suo Removed Paths: ------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.sln trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.suo Modified: trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-04-17 09:31:10 UTC (rev 337) +++ trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-04-17 17:00:41 UTC (rev 338) @@ -28,26 +28,22 @@ </UpgradeBackupLocation> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <OutputPath>bin\Debug\</OutputPath> + <OutputPath>..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>DEBUG;TRACE</DefineConstants> - <DocumentationFile> - </DocumentationFile> <DebugSymbols>true</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> - <NoWarn> - </NoWarn> - <Optimize>false</Optimize> + <Optimize>true</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> <TreatWarningsAsErrors>false</TreatWarningsAsErrors> <WarningLevel>4</WarningLevel> - <DebugType>full</DebugType> + <DebugType>Full</DebugType> <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> @@ -58,13 +54,9 @@ <ConfigurationOverrideFile> </ConfigurationOverrideFile> <DefineConstants>TRACE</DefineConstants> - <DocumentationFile> - </DocumentationFile> <DebugSymbols>false</DebugSymbols> <FileAlignment>4096</FileAlignment> <NoStdLib>false</NoStdLib> - <NoWarn> - </NoWarn> <Optimize>true</Optimize> <RegisterForComInterop>false</RegisterForComInterop> <RemoveIntegerChecks>false</RemoveIntegerChecks> @@ -73,14 +65,20 @@ <DebugType>none</DebugType> <ErrorReport>prompt</ErrorReport> </PropertyGroup> + <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> + <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> + <PlatformTarget>AnyCPU</PlatformTarget> + </PropertyGroup> <ItemGroup> <Reference Include="Core"> - <HintPath>..\..\..\MediaPortal\Core\bin\Release\Core.DLL</HintPath> + <HintPath>..\..\..\..\MediaPortal\Core\bin\Release\Core.DLL</HintPath> <SpecificVersion>False</SpecificVersion> + <Private>False</Private> </Reference> <Reference Include="Databases"> <HintPath>..\..\..\MediaPortal\Databases\bin\Release\Databases.DLL</HintPath> <SpecificVersion>False</SpecificVersion> + <Private>False</Private> </Reference> <Reference Include="System"> <Name>System</Name> @@ -100,6 +98,7 @@ <Reference Include="Utils"> <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.DLL</HintPath> <SpecificVersion>False</SpecificVersion> + <Private>False</Private> </Reference> <COMReference Include="AxShockwaveFlashObjects"> <Guid>{D27CDB6B-AE6D-11CF-96B8-444553540000}</Guid> Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-04-17 09:31:10 UTC (rev 337) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2007-04-17 17:00:41 UTC (rev 338) @@ -22,7 +22,7 @@ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> <DebugType>Full</DebugType> - <Optimize>false</Optimize> + <Optimize>true</Optimize> <OutputPath>..\..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\Windows\</OutputPath> <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.sln =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.sln 2007-04-17 09:31:10 UTC (rev 337) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.sln 2007-04-17 17:00:41 UTC (rev 338) @@ -1,41 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -# SharpDevelop 2.1.0.2429 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineVideos", "OnlineVideos.csproj", "{E0D9D390-CDD6-4B98-86F3-6EB04A958882}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runner", "Runner.csproj", "{EFABB07B-B050-45AD-A93F-C5047F15512F}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlashVideoPlayer", "..\..\..\..\Documents and Settings\GZamor1\Desktop\OnlineVideos_0.22\source code\MP_External_FlashPlayer\FlashVideoPlayer.csproj", "{9C825F0E-ED58-4DBC-A8FB-C69569CC830C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Release|Any CPU.Build.0 = Release|Any CPU - {7541B258-A607-47C0-8F28-761ACC5F727A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7541B258-A607-47C0-8F28-761ACC5F727A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7541B258-A607-47C0-8F28-761ACC5F727A}.Release|Any CPU.Build.0 = Release|Any CPU - {7541B258-A607-47C0-8F28-761ACC5F727A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EFABB07B-B050-45AD-A93F-C5047F15512F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EFABB07B-B050-45AD-A93F-C5047F15512F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EFABB07B-B050-45AD-A93F-C5047F15512F}.Release|Any CPU.Build.0 = Release|Any CPU - {EFABB07B-B050-45AD-A93F-C5047F15512F}.Release|Any CPU.ActiveCfg = Release|Any CPU - 38EA1FC7-3151-43FF-8E0B-545524016799.Debug|Any CPU.Build.0 = Debug|Any CPU - 38EA1FC7-3151-43FF-8E0B-545524016799.Debug|Any CPU.ActiveCfg = Debug|Any CPU - 38EA1FC7-3151-43FF-8E0B-545524016799.Release|Any CPU.Build.0 = Release|Any CPU - 38EA1FC7-3151-43FF-8E0B-545524016799.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Release|Any CPU.Build.0 = Release|Any CPU - {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Release|Any CPU.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.suo =================================================================== (Binary files differ) Copied: trunk/plugins/OnlineVideos/Source/OnlineVideos.sln (from rev 335, trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.sln) =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos.sln (rev 0) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos.sln 2007-04-17 17:00:41 UTC (rev 338) @@ -0,0 +1,41 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +# SharpDevelop 2.1.0.2429 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineVideos", "OnlineVideos\OnlineVideos.csproj", "{E0D9D390-CDD6-4B98-86F3-6EB04A958882}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runner", "OnlineVideos\Runner.csproj", "{EFABB07B-B050-45AD-A93F-C5047F15512F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FlashVideoPlayer", "FLV Player\FlashVideoPlayer.csproj", "{9C825F0E-ED58-4DBC-A8FB-C69569CC830C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E0D9D390-CDD6-4B98-86F3-6EB04A958882}.Release|Any CPU.Build.0 = Release|Any CPU + {7541B258-A607-47C0-8F28-761ACC5F727A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7541B258-A607-47C0-8F28-761ACC5F727A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7541B258-A607-47C0-8F28-761ACC5F727A}.Release|Any CPU.Build.0 = Release|Any CPU + {7541B258-A607-47C0-8F28-761ACC5F727A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EFABB07B-B050-45AD-A93F-C5047F15512F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EFABB07B-B050-45AD-A93F-C5047F15512F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EFABB07B-B050-45AD-A93F-C5047F15512F}.Release|Any CPU.Build.0 = Release|Any CPU + {EFABB07B-B050-45AD-A93F-C5047F15512F}.Release|Any CPU.ActiveCfg = Release|Any CPU + 38EA1FC7-3151-43FF-8E0B-545524016799.Debug|Any CPU.Build.0 = Debug|Any CPU + 38EA1FC7-3151-43FF-8E0B-545524016799.Debug|Any CPU.ActiveCfg = Debug|Any CPU + 38EA1FC7-3151-43FF-8E0B-545524016799.Release|Any CPU.Build.0 = Release|Any CPU + 38EA1FC7-3151-43FF-8E0B-545524016799.Release|Any CPU.ActiveCfg = Release|Any CPU + {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Release|Any CPU.Build.0 = Release|Any CPU + {9C825F0E-ED58-4DBC-A8FB-C69569CC830C}.Release|Any CPU.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Copied: trunk/plugins/OnlineVideos/Source/OnlineVideos.suo (from rev 335, trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.suo) =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2007-08-24 03:45:35
|
Revision: 862 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=862&view=rev Author: gregmac45 Date: 2007-08-23 20:45:27 -0700 (Thu, 23 Aug 2007) Log Message: ----------- Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs trunk/plugins/OnlineVideos/Source/OnlineVideos.sln Modified: trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/FLV Player/FlashVideoPlayer.csproj 2007-08-24 03:45:27 UTC (rev 862) @@ -28,7 +28,7 @@ </UpgradeBackupLocation> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> - <OutputPath>..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> + <OutputPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -47,7 +47,7 @@ <ErrorReport>prompt</ErrorReport> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> - <OutputPath>..\MediaPortal2\xbmc\bin\Debug\plugins\ExternalPlayers\</OutputPath> + <OutputPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\ExternalPlayers\</OutputPath> <AllowUnsafeBlocks>false</AllowUnsafeBlocks> <BaseAddress>285212672</BaseAddress> <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow> @@ -70,15 +70,18 @@ <PlatformTarget>AnyCPU</PlatformTarget> </PropertyGroup> <ItemGroup> + <Reference Include="AxInterop.ShockwaveFlashObjects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>bin\Debug\AxInterop.ShockwaveFlashObjects.dll</HintPath> + </Reference> <Reference Include="Core"> <HintPath>..\..\..\..\MediaPortal\Core\bin\Release\Core.DLL</HintPath> <SpecificVersion>False</SpecificVersion> <Private>False</Private> </Reference> - <Reference Include="Databases"> - <HintPath>..\..\..\MediaPortal\Databases\bin\Release\Databases.DLL</HintPath> + <Reference Include="Interop.ShockwaveFlashObjects, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <Private>False</Private> + <HintPath>bin\Debug\Interop.ShockwaveFlashObjects.dll</HintPath> </Reference> <Reference Include="System"> <Name>System</Name> @@ -96,18 +99,10 @@ <Name>System.XML</Name> </Reference> <Reference Include="Utils"> - <HintPath>..\..\..\MediaPortal\Utils\bin\Release\Utils.DLL</HintPath> + <HintPath>..\..\..\..\Mediaportal\Utils\bin\Release\Utils.DLL</HintPath> <SpecificVersion>False</SpecificVersion> <Private>False</Private> </Reference> - <COMReference Include="AxShockwaveFlashObjects"> - <Guid>{D27CDB6B-AE6D-11CF-96B8-444553540000}</Guid> - <VersionMajor>1</VersionMajor> - <VersionMinor>0</VersionMinor> - <Lcid>0</Lcid> - <WrapperTool>aximp</WrapperTool> - <Isolated>False</Isolated> - </COMReference> <COMReference Include="stdole"> <Guid>{00020430-0000-0000-C000-000000000046}</Guid> <VersionMajor>2</VersionMajor> Modified: trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -10,278 +10,234 @@ namespace MediaPortal.MyFLVPlayer { - public class FlvPlayerPlugin : IExternalPlayer - { - //public static bool _playerIsPaused; - string _currentFile = String.Empty; - //bool _started; - //bool _ended; - bool _notifyPlaying = false; - double _duration; - double _currentPosition; - DateTime _updateTimer; - bool _needUpdate = true; - //private string[] _supportedExtension = new string[5]; + public class FlvPlayerPlugin : IExternalPlayer + { + //public static bool _playerIsPaused; + string _currentFile = String.Empty; + //bool _started; + //bool _ended; + bool _notifyPlaying = false; + double _duration; + double _currentPosition; + DateTime _updateTimer; + bool _needUpdate = true; + //private string[] _supportedExtension = new string[5]; - bool _isFullScreen = false; - int _positionX = 10, _positionY = 10, _videoWidth = 100, _videoHeight = 100; - //protected ILog _log; + bool _isFullScreen = false; + int _positionX = 10, _positionY = 10, _videoWidth = 100, _videoHeight = 100; + //protected ILog _log; - public static FlashControl FlvControl = null; + public static FlashControl FlvControl = null; - public enum PlayState - { - Init, - Playing, - Paused, - Ended - } - PlayState _playState = PlayState.Init; - public FlvPlayerPlugin() - { - //ServiceProvider services = GlobalServiceProvider.Instance; - //_log = services.Get<ILog>(); - } + public enum PlayState + { + Init, + Playing, + Paused, + Ended + } + PlayState _playState = PlayState.Init; + public FlvPlayerPlugin() + { + //ServiceProvider services = GlobalServiceProvider.Instance; + //_log = services.Get<ILog>(); + } - public override string Description() - { - return "Flash Player"; - } + public override string Description() + { + return "Flash Player"; + } - public override string PlayerName - { - get { return "FlvPlayer"; } - } + public override string PlayerName + { + get { return "FlvPlayer"; } + } - public override string AuthorName - { - get { return "Gregmac45"; } - } + public override string AuthorName + { + get { return "Gregmac45"; } + } - public override string VersionNumber - { - get { return "0.1"; } - } + public override string VersionNumber + { + get { return "0.1"; } + } - public override string[] GetAllSupportedExtensions() + public override string[] GetAllSupportedExtensions() + { + String[] laSupported = new String[1]; + laSupported[0] = ".flv"; + return laSupported; + } + /* + public string[] GetAllSupportedStreams() { - String[] laSupported = new String[1]; - laSupported[0] = ".flv"; + String[] laSupported = new String[2]; + laSupported[0] = "http"; + laSupported[0] = "RTMP"; return laSupported; + } + */ + public override bool SupportsFile(string filename) + { + string ext = null; + int dot = filename.LastIndexOf("."); // couldn't find the dot to get the extension + if (dot == -1) return false; - public override bool SupportsFile(string filename) - { - string ext = null; - int dot = filename.LastIndexOf("."); // couldn't find the dot to get the extension - if (dot == -1) return false; + ext = filename.Substring(dot).Trim(); + if (ext.Length == 0) return false; // no extension so return false; - ext = filename.Substring(dot).Trim(); - if (ext.Length == 0) return false; // no extension so return false; + ext = ext.ToLower(); + if (".flv".Equals(ext)) { return true; }; + return false; + } - ext = ext.ToLower(); - if (".flv".Equals(ext)) { return true; }; - return false; - } + public override bool Play(string strFile) + { + Log.Info("Playing flv with FlvPlayer"); + try + { + FlvControl = new FlashControl(); + FlvControl.Player.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(OnFlashCall); + FlvControl.Player.LoadMovie(0, System.IO.Directory.GetCurrentDirectory()+"\\player.swf"); + + //FlvControl.Player.Movie = System.IO.Directory.GetCurrentDirectory()+"\\player.swf"; + FlvControl.Player.FlashVars = String.Format("&file={0}&autostart=true&enablejs=true&backcolor=0x000000&frontcolor=0xCCCCCC&showicons=false&showvolume=false&showdigits=false&displayheight={1}&allowfullscreen=true",strFile.Replace("&","%26"),9999); + - public override bool Play(string strFile) - { - try - { - //if (FlvControl == null) - //{ - // FlvControl.Player.u - //} - FlvControl = new FlashControl(); - //FlvControl.Player.BackgroundColor = ; - FlvControl.Player.OnReadyStateChange += new _IShockwaveFlashEvents_OnReadyStateChangeEventHandler(OnReady); - FlvControl.Player.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(OnFlashCall); - //FlvControl.Player.LoadMovie(0, @"C:\Dev\FlashExternalAPI\player.swf"); - //Log.Info("player path:{0}", System.IO.Directory.GetCurrentDirectory() + "\\player.swf"); - FlvControl.Player.LoadMovie(0, System.IO.Directory.GetCurrentDirectory()+"\\player.swf"); - - GUIGraphicsContext.form.Controls.Add(FlvControl); - GUIWindowManager.OnNewAction +=new OnActionHandler(OnAction2); - //} - FlvControl.Player.CallFunction("<invoke name=\"loadAndPlayVideo\" returntype=\"xml\"><arguments><string>"+strFile+"</string></arguments></invoke>"); - - //FlvControl.Player.FSCommand += new _IShockwaveFlashEvents_FSCommandEventHandler(OnFSCommand); - //FlvControl.Player.OnProgress += new _IShockwaveFlashEvents_OnProgressEventHandler(OnProgress); - //FlvControl.Player.Play(); + GUIGraphicsContext.form.Controls.Add(FlvControl); + GUIWindowManager.OnNewAction +=new OnActionHandler(OnAction2); + + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null); + msg.Label = strFile; + GUIWindowManager.SendThreadMessage(msg); + _notifyPlaying = true; + FlvControl.ClientSize = new Size(0, 0); + FlvControl.Visible = true; + FlvControl.Enabled = true; + _needUpdate = true; + _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; + _positionX = GUIGraphicsContext.VideoWindow.Left; + _positionY = GUIGraphicsContext.VideoWindow.Top; + _videoWidth = GUIGraphicsContext.VideoWindow.Width; + _videoHeight = GUIGraphicsContext.VideoWindow.Height; - //} + _currentFile = strFile; + _duration = -1; + _currentPosition = -1; + _playState = PlayState.Playing; + _updateTimer = DateTime.Now; + SetVideoWindow(); + return true; + } + catch (Exception) + { + } + return false; + } - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYBACK_STARTED, 0, 0, 0, 0, 0, null); - msg.Label = strFile; - GUIWindowManager.SendThreadMessage(msg); + public void OnFlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent foEvent) + { + //Log.Info("OnFlashCall reached with value request:{0},Object:{1}", foEvent.request, sender); + XmlDocument document = new XmlDocument(); + document.LoadXml(foEvent.request); - + // Get all the arguments + XmlNodeList list = document.GetElementsByTagName("invoke"); + String lsName = list[0].Attributes["name"].Value; + list = document.GetElementsByTagName("arguments"); + String lsState = list[0].FirstChild.InnerText; + if (lsName.Equals("getUpdate")) + { + switch (lsState) + { + case "state": + switch(list[0].ChildNodes[1].InnerText){ + case "0": + case "1": + if(_playState == PlayState.Playing){ + _playState = PlayState.Paused; + } + else { + _playState = PlayState.Init; + } + break; + case "2": + _playState = PlayState.Playing; + break; + case "3": + _playState = PlayState.Ended; + break; + } + + + break; + case "time": + _currentPosition = Convert.ToInt32(list[0].ChildNodes[1].InnerText); + _duration = _currentPosition+ Convert.ToInt32(list[0].ChildNodes[2].InnerText); + + break; + + } + } + } + public override bool CanSeek() + { + return true; + } + public void OnAction2(Action foAction) + { + //Log.Info("received action:"+foAction.wID); + //if (foAction.wID == Action.ActionType.ACTION_SHOW_GUI || foAction.wID == Action.ActionType.ACTION_SHOW_FULLSCREEN) + //{ + + //SetVideoWindow(); + //} + } + public override double Duration + { + get + { + return _duration; + } + } - - //_started = false; - //_ended = false; - _notifyPlaying = true; + public override double CurrentPosition + { + get + { + if (FlvControl == null) return 0.0d; + //UpdateStatus(); + //if (_started == false) return 0; + try + { + + + _updateTimer = DateTime.Now; + //return _currentPosition; + //Log.Info("Flash Player - current time {0}", _currentPosition); + + //} + } + catch (Exception e) + { + //_log.Error(e); + Log.Error(e); + } + try + { + return _currentPosition; + } + catch (Exception) + { + FlvControl = null; + return 0.0d; + } + } - - //FlvControl.Visible = true; - //FlvControl.Enabled = true; - FlvControl.ClientSize = new Size(0, 0); - FlvControl.Visible = true; - FlvControl.Enabled = true; - //GUIGraphicsContext.form.Focus(); - - _needUpdate = true; - _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; - _positionX = GUIGraphicsContext.VideoWindow.Left; - _positionY = GUIGraphicsContext.VideoWindow.Top; - _videoWidth = GUIGraphicsContext.VideoWindow.Width; - _videoHeight = GUIGraphicsContext.VideoWindow.Height; - - //_started = true; - //SetWindows(); - - //_playerIsPaused = false; - _currentFile = strFile; - _duration = -1; - _currentPosition = -1; - _playState = PlayState.Playing; - _updateTimer = DateTime.Now; - SetVideoWindow(); - return true; - } - catch (Exception) - { - } - return false; - } - - public void OnReady(object sender,_IShockwaveFlashEvents_OnReadyStateChangeEvent foEvent) - { - /* - - Log.Info("OnReady2 reached with value {0}", foEvent.newState); - if (foEvent.newState == 4 && _duration <=0) - { - - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoTotalTime\" returntype=\"string\"></invoke>"); - //Log.Info("flash request received with :{0}",lsXml); - XmlDocument document = new XmlDocument(); - document.LoadXml(lsXml); - XmlNodeList list = document.GetElementsByTagName("number"); - _duration = Convert.ToDouble(list[0].InnerText); - Log.Info("Duration Set to {0}",_duration); - } - * */ - - } - public void OnFlashCall(object sender, _IShockwaveFlashEvents_FlashCallEvent foEvent) - { - Log.Info("OnFlashCall reached with value request:{0},Object:{1}", foEvent.request, sender); - XmlDocument document = new XmlDocument(); - document.LoadXml(foEvent.request); - - // Get all the arguments - XmlNodeList list = document.GetElementsByTagName("invoke"); - String lsName = list[0].Attributes["name"].Value; - list = document.GetElementsByTagName("arguments"); - String lsState = list[0].FirstChild.InnerText; - //Log.Info("invoke:{0} argument:{1}",lsName,lsState); - //if (lsName.Equals("UpdateDuration")) - //{ - // Log.Info("received update duration with value {0}", lsState); - //} - if (lsName.Equals("updateStatus")) - { - switch (lsState) - { - case "stopped": - _playState = PlayState.Init; - break; - case "buffering": - if (_playState == PlayState.Playing) - { - //_playState = PlayState.Ended; - } - else - { - _playState = PlayState.Playing; - } - break; - case "playing": - _playState = PlayState.Playing; - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoTotalTime\" returntype=\"string\"></invoke>"); - //Log.Info("flash request received with :{0}",lsXml); - document = new XmlDocument(); - document.LoadXml(lsXml); - list = document.GetElementsByTagName("number"); - _duration = Convert.ToDouble(list[0].InnerText); - Log.Info("Duration Set to {0}", _duration); - break; - case "paused": - _playState = PlayState.Paused; - break; - case "connectionError": - _playState = PlayState.Ended; - break; - - - } - } - } - - public void OnAction2(Action foAction) - { - } - public override double Duration - { - get - { - return _duration; - } - } - - public override double CurrentPosition - { - get - { - if (FlvControl == null) return 0.0d; - //UpdateStatus(); - //if (_started == false) return 0; - try - { - TimeSpan loTimeSinceUpdate = DateTime.Now - _updateTimer; - if (loTimeSinceUpdate.Seconds > 1) - { - //Log.Info("Flash Player - Updating Position"); - String lsXml = FlvControl.Player.CallFunction("<invoke name=\"getVideoCurrentTime\" returntype=\"string\"></invoke>"); - - XmlDocument document = new XmlDocument(); - document.LoadXml(lsXml); - XmlNodeList list = document.GetElementsByTagName("number"); - _currentPosition = Convert.ToDouble(list[0].InnerText); - _updateTimer = DateTime.Now; - //Log.Info("Flash Player - current time {0}", _currentPosition); - - } - } - catch (Exception e) - { - //_log.Error(e); - Log.Error(e); - } - try - { - return _currentPosition; - } - catch (Exception) - { - FlvControl = null; - return 0.0d; - } - } - - } - /* + } + /* public override int Speed { get @@ -342,336 +298,340 @@ } } } - * */ - public override bool Ended - { - get - { - return (_playState==PlayState.Ended); - } - } - public override bool Playing - { - get - { - try - { - if (FlvControl == null) - return false; - //UpdateStatus(); - //String lsPlaying = FlvControl.Player.CallFunction("<invoke name=\"videoPlaying\" returntype=\"xml\"></invoke>"); - //Log.Info("Flv Playing:{0}", lsPlaying); - //Log.Info("Player.playing:{0}", FlvControl.Player.Playing); - //Log.Info("control.playing:{0}", FlvControl.Playing); - //if (_started == false) - // return false; - //if (Paused) return true; - //return true; - return (_playState == PlayState.Playing || _playState == PlayState.Paused); + * */ + public override bool Ended + { + get + { + return (_playState==PlayState.Ended); + } + } + public override bool Playing + { + get + { + try + { + if (FlvControl == null) + return false; + //UpdateStatus(); + //String lsPlaying = FlvControl.Player.CallFunction("<invoke name=\"videoPlaying\" returntype=\"xml\"></invoke>"); + //Log.Info("Flv Playing:{0}", lsPlaying); + //Log.Info("Player.playing:{0}", FlvControl.Player.Playing); + //Log.Info("control.playing:{0}", FlvControl.Playing); + //if (_started == false) + // return false; + //if (Paused) return true; + //return true; + return (_playState == PlayState.Playing || _playState == PlayState.Paused); - } - catch (Exception) - { - FlvControl = null; - return false; - } + } + catch (Exception) + { + FlvControl = null; + return false; + } - } - } + } + } - public override void Pause() - { - if (FlvControl == null) return; - //UpdateStatus(); - //if (_started == false) return; - try - { - if (_playState == PlayState.Paused) - { - //FlvControl.Player.Play(); - FlvControl.Player.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>"); - //_playerIsPaused = false; - } - else - { - FlvControl.Player.CallFunction("<invoke name=\"pauseVideo\" returntype=\"xml\"></invoke>"); - //FlvControl.Player.StopPlay(); - //_playerIsPaused = true; - } - } - catch (Exception) - { - FlvControl = null; - return; - } - } + public override void Pause() + { + if (FlvControl == null) return; + //UpdateStatus(); + //if (_started == false) return; + try + { + if (_playState == PlayState.Paused) + { + //FlvControl.Player.Play(); + //FlvControl.Player.CallFunction("<invoke name=\"playVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"playpause\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>playpause</string></arguments></invoke>"); + //_playerIsPaused = false; + } + else + { + //FlvControl.Player.CallFunction("<invoke name=\"pauseVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"playpause\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>playpause</string></arguments></invoke>"); + //FlvControl.Player.StopPlay(); + //_playerIsPaused = true; + } + } + catch (Exception) + { + FlvControl = null; + return; + } + } - public override bool Paused - { - get - { - try - { - //if (_started == false) return false; - //return _playerIsPaused; - return (_playState == PlayState.Paused); - } - catch (Exception) - { - FlvControl = null; - return false; - } - } - } + public override bool Paused + { + get + { + try + { + //if (_started == false) return false; + //return _playerIsPaused; + return (_playState == PlayState.Paused); + } + catch (Exception) + { + FlvControl = null; + return false; + } + } + } - public override string CurrentFile - { - get - { - return _currentFile; - } - } + public override string CurrentFile + { + get + { + return _currentFile; + } + } - public override void Process() - { - //Log.Info("in Process"); - //UpdateStatus(); - if (_needUpdate) - { - SetVideoWindow(); - } - if (CurrentPosition >= 10.0) - { - if (_notifyPlaying) - { - _notifyPlaying = false; - GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYING_10SEC, 0, 0, 0, 0, 0, null); - msg.Label = CurrentFile; - GUIWindowManager.SendThreadMessage(msg); - //Log.Info("Message Playing 10 sec sent"); - } - } - } - public override void SetVideoWindow() - { - //Log.Info("set video called fullscreen = {0} and grphic.Fullscreen {0}",_isFullScreen,GUIGraphicsContext.IsFullScreenVideo); - if (FlvControl == null) return; - if (GUIGraphicsContext.IsFullScreenVideo != _isFullScreen) - { - _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; - _needUpdate = true; - } - if (!_needUpdate) return; - _needUpdate = false; + public override void Process() + { + //Log.Info("in Process"); + //UpdateStatus(); + if (_needUpdate) + { + SetVideoWindow(); + } + if (CurrentPosition >= 10.0) + { + if (_notifyPlaying) + { + _notifyPlaying = false; + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_PLAYING_10SEC, 0, 0, 0, 0, 0, null); + msg.Label = CurrentFile; + GUIWindowManager.SendThreadMessage(msg); + //Log.Info("Message Playing 10 sec sent"); + } + } + } + public override void SetVideoWindow() + { + + if (FlvControl == null) return; + if (GUIGraphicsContext.IsFullScreenVideo != _isFullScreen) + { + _isFullScreen = GUIGraphicsContext.IsFullScreenVideo; + _needUpdate = true; + } + if (!_needUpdate) return; + _needUpdate = false; - if (_isFullScreen) - { - Log.Info("Flv:Fullscreen"); + if (_isFullScreen) + { + Log.Info("Flv:Fullscreen"); - _positionX = GUIGraphicsContext.OverScanLeft; - _positionY = GUIGraphicsContext.OverScanTop; - _videoWidth = GUIGraphicsContext.OverScanWidth; - _videoHeight = GUIGraphicsContext.OverScanHeight; + _positionX = GUIGraphicsContext.OverScanLeft; + _positionY = GUIGraphicsContext.OverScanTop; + _videoWidth = GUIGraphicsContext.OverScanWidth; + _videoHeight = GUIGraphicsContext.OverScanHeight; - FlvControl.Location = new Point(0, 0); - FlvControl.ClientSize = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); - FlvControl.Size = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); + FlvControl.Location = new Point(0, 0); + FlvControl.ClientSize = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); + FlvControl.Size = new System.Drawing.Size(GUIGraphicsContext.Width, GUIGraphicsContext.Height); - _videoRectangle = new Rectangle(0, 0, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); - _sourceRectangle = _videoRectangle; + _videoRectangle = new Rectangle(0, 0, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); + _sourceRectangle = _videoRectangle; - //FlvControl.fullScreen=true; - //FlvControl.stretchToFit = true; - //Log.Info("FlvPlayer:done"); - return; - } - else - { + //FlvControl.fullScreen=true; + //FlvControl.stretchToFit = true; + //Log.Write("FlvPlayer:done"); + return; + } + else + { - FlvControl.ClientSize = new System.Drawing.Size(_videoWidth, _videoHeight); - FlvControl.Location = new Point(_positionX, _positionY); + FlvControl.ClientSize = new System.Drawing.Size(_videoWidth, _videoHeight); + FlvControl.Location = new Point(_positionX, _positionY); - _videoRectangle = new Rectangle(_positionX, _positionY, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); - _sourceRectangle = _videoRectangle; - //Log.Info("AudioPlayer:set window:({0},{1})-({2},{3})",_positionX,_positionY,_positionX+FlvControl.ClientSize.Width,_positionY+FlvControl.ClientSize.Height); - } - //FlvControl.uiMode = "none"; - //FlvControl.windowlessVideo = true; - //FlvControl.enableContextMenu = false; - //FlvControl.Ctlenabled = false; - GUIGraphicsContext.form.Controls[0].Enabled = false; - } + _videoRectangle = new Rectangle(_positionX, _positionY, FlvControl.ClientSize.Width, FlvControl.ClientSize.Height); + _sourceRectangle = _videoRectangle; + //Log.Write("AudioPlayer:set window:({0},{1})-({2},{3})",_positionX,_positionY,_positionX+FlvControl.ClientSize.Width,_positionY+FlvControl.ClientSize.Height); + } + + GUIGraphicsContext.form.Controls[0].Enabled = false; + } - public override void Stop() - { - if (FlvControl == null) return; - try - { - //Log.Info("before {0}", Playing); - //FlvControl.Player.Stop(); - FlvControl.Player.CallFunction("<invoke name=\"stopVideo\" returntype=\"xml\"></invoke>"); - FlvControl.Visible = false; - FlvControl.ClientSize = new Size(0, 0); - FlvControl.Dispose(); - //_playerIsPaused = false; - //_started = false; - //Playing = false; - //GUIGraphicsContext.OnNewAction -= new OnActionHandler(OnAction2); - //Log.Info("after {0}", Playing); - } - catch (Exception) - { - FlvControl = null; - } - } + public override void Stop() + { + //Log.Info("Attempting to stop..."); + if (FlvControl == null) return; + try + { + //Log.Info("before {0}", Playing); + //FlvControl.Player.Stop(); + //FlvControl.Player.CallFunction("<invoke name=\"stopVideo\" returntype=\"xml\"></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"stop\" returntype=\"xml\"></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>stop</string></arguments></invoke>"); - public override bool HasVideo - { - get - { - return true; - } - } + FlvControl.Visible = false; + FlvControl.ClientSize = new Size(0, 0); + FlvControl.Dispose(); + //_playerIsPaused = false; + //_started = false; + //Playing = false; + //GUIGraphicsContext.OnNewAction -= new OnActionHandler(OnAction2); + //Log.Info("after {0}", Playing); + } + catch (Exception) + { + FlvControl = null; + } + } - public override bool FullScreen - { - - get - { - return _isFullScreen; - } - set - { - if (value != _isFullScreen) - { - //Log.Info("setting fullscreen to {0}", value); - _isFullScreen = value; - _needUpdate = true; - } - } - } + public override bool HasVideo + { + get + { + return true; + } + } - public override int PositionX - { - get { return _positionX; } - set - { - if (value != _positionX) - { - //Log.Info("setting position x to {0}", value); - _positionX = value; - _needUpdate = true; - } - } - } + public override bool FullScreen + { + + get + { + return _isFullScreen; + } + set + { + if (value != _isFullScreen) + { + //Log.Info("setting fullscreen to {0}", value); + _isFullScreen = value; + _needUpdate = true; + } + } + } - public override int PositionY - { - get { return _positionY; } - set - { - if (value != _positionY) - { - //Log.Info("setting position y to {0}", value); - _positionY = value; - _needUpdate = true; - } - } - } + public override int PositionX + { + get { return _positionX; } + set + { + if (value != _positionX) + { + //Log.Info("setting position x to {0}", value); + _positionX = value; + _needUpdate = true; + } + } + } - public override int RenderWidth - { - get { return _videoWidth; } - set - { - if (value != _videoWidth) - { - //Log.Info("setting width to {0}", value); - _videoWidth = value; - _needUpdate = true; - } - } - } - public override int RenderHeight - { - get { return _videoHeight; } - set - { - if (value != _videoHeight) - { - //Log.Info("setting position height to {0}", value); - _videoHeight = value; - _needUpdate = true; - } - } - } + public override int PositionY + { + get { return _positionY; } + set + { + if (value != _positionY) + { + //Log.Info("setting position y to {0}", value); + _positionY = value; + _needUpdate = true; + } + } + } + public override int RenderWidth + { + get { return _videoWidth; } + set + { + if (value != _videoWidth) + { + //Log.Info("setting width to {0}", value); + _videoWidth = value; + _needUpdate = true; + } + } + } + public override int RenderHeight + { + get { return _videoHeight; } + set + { + if (value != _videoHeight) + { + //Log.Info("setting position height to {0}", value); + _videoHeight = value; + _needUpdate = true; + } + } + } - - public override void SeekRelative(double dTime) - { - double dCurTime = CurrentPosition; - dTime = dCurTime + dTime; - if (dTime < 0.0d) dTime = 0.0d; - if (dTime < Duration) - { - SeekAbsolute(dTime); - } - } - public override void SeekAbsolute(double dTime) - { - if (dTime < 0.0d) dTime = 0.0d; - if (dTime < Duration) - { - if (FlvControl == null) return; - try - { - Log.Info("Attempting to seek..."); - FlvControl.Player.CallFunction("<invoke name=\"videoSeek\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); - //FlvControl.Player.CurrentFrame() = (int)dTime; - Log.Info("seeking complete"); - } - catch (Exception e) { - Log.Error(e); - } - } - } + + public override void SeekRelative(double dTime) + { + double dCurTime = CurrentPosition; + dTime = dCurTime + dTime; + if (dTime < 0.0d) dTime = 0.0d; + if (dTime < Duration) + { + SeekAbsolute(dTime); + } + } - public override void SeekRelativePercentage(int iPercentage) - { - double dCurrentPos = CurrentPosition; - double dDuration = Duration; + public override void SeekAbsolute(double dTime) + { + if (dTime < 0.0d) dTime = 0.0d; + if (dTime < Duration) + { + if (FlvControl == null) return; + try + { + Log.Info("Attempting to seek..."); + //FlvControl.Player.CallFunction("<invoke name=\"videoSeek\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); + //FlvControl.Player.CallFunction("<invoke name=\"scrub\" returntype=\"xml\"><arguments><number>" + dTime + "</number></arguments></invoke>"); + FlvControl.Player.CallFunction("<invoke name=\"sendEvent\" returntype=\"xml\"><arguments><string>scrub</string><number>" + dTime + "</number></arguments></invoke>"); + //FlvControl.Player.CurrentFrame() = (int)dTime; + Log.Info("seeking complete"); + } + catch (Exception e) { + Log.Error(e); + } + } + } - double fCurPercent = (dCurrentPos / Duration) * 100.0d; - double fOnePercent = Duration / 100.0d; - fCurPercent = fCurPercent + (double)iPercentage; - fCurPercent *= fOnePercent; - if (fCurPercent < 0.0d) fCurPercent = 0.0d; - if (fCurPercent < Duration) - { - SeekAbsolute(fCurPercent); - } - } + public override void SeekRelativePercentage(int iPercentage) + { + double dCurrentPos = CurrentPosition; + double dDuration = Duration; + double fCurPercent = (dCurrentPos / Duration) * 100.0d; + double fOnePercent = Duration / 100.0d; + fCurPercent = fCurPercent + (double)iPercentage; + fCurPercent *= fOnePercent; + if (fCurPercent < 0.0d) fCurPercent = 0.0d; + if (fCurPercent < Duration) + { + SeekAbsolute(fCurPercent); + } + } - public override void SeekAsolutePercentage(int iPercentage) - { - if (iPercentage < 0) iPercentage = 0; - if (iPercentage >= 100) iPercentage = 100; - double fPercent = Duration / 100.0f; - fPercent *= (double)iPercentage; - SeekAbsolute(fPercent); - } - //private void VideoEnded - //{ - //} + public override void SeekAsolutePercentage(int iPercentage) + { + if (iPercentage < 0) iPercentage = 0; + if (iPercentage >= 100) iPercentage = 100; + double fPercent = Duration / 100.0f; + fPercent *= (double)iPercentage; + SeekAbsolute(fPercent); + } + - } + } } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -238,7 +238,7 @@ if (dlgSel != null) { dlgSel.Add("Save"); // Save - Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); + //Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); if(msSelectedCategoryValue.StartsWith("fav:") ==false){ dlgSel.Add("Add to favorites"); } @@ -254,7 +254,7 @@ } dlgSel.DoModal(GetID); int liSelectedIdx = dlgSel.SelectedId; - Log.Info("Selected id {0}",liSelectedIdx); + //Log.Info("Selected id {0}",liSelectedIdx); switch(liSelectedIdx){ case 1: SaveVideo(moCurrentVideoList[facadeView.SelectedListItemIndex -1]); @@ -276,14 +276,14 @@ //Log.Info("Getting related videos on {0} using tags:{1}",SiteUtilFactory.getSiteUtil(msSelectedSiteId),moCurrentVideoList[liSelected].Tags); SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); //Log.Info("VideoList before:"); - foreach(VideoInfo video in moCurrentVideoList){ - Log.Info(video.Title); - } + //foreach(VideoInfo video in moCurrentVideoList){ + //Log.Info(video.Title); + //} moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].Tags); //Log.Info("VideoList after:"); - foreach(VideoInfo video in moCurrentVideoList){ - Log.Info(video.Title); - } + //foreach(VideoInfo video in moCurrentVideoList){ + // Log.Info(video.Title); + //} DisplayVideos(false); break; @@ -314,7 +314,7 @@ protected override void OnClicked(int controlId, GUIControl control, Action.ActionType actionType) { //Log.Info("Onclicked action type:{0}",actionType); - if (control == facadeView) + if (control == facadeView && actionType== Action.ActionType.ACTION_SELECT_ITEM) { if (_CurrentState == State.home) @@ -659,9 +659,7 @@ DisplayVideoInfo(moCurrentVideoList[item.ItemId-1]); } } - public void OnAction2(Action foAction){ - Log.Info("MyFlashPlayer received action:"+foAction.wID); - } + private bool GetUserInputString(ref string sString) { Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -54,7 +54,7 @@ { //ServiceProvider loServices = GlobalServiceProvider.Instance; //moLog = loServices.Get<ILog>(); - } + } public virtual List<GUIOnlineVideos.VideoInfo> getSiteFavorites(String fsUser){ return new List<GUIOnlineVideos.VideoInfo>(); @@ -78,7 +78,7 @@ Log.Info("SiteUtilBase AddFavorites."); FavoritesDatabase db = FavoritesDatabase.getInstance(); db.addFavoriteVideo(foVideo,fsSiteId); - + } public virtual bool RemoveFavorite(GUIOnlineVideos.VideoInfo foVideo){ Log.Info("SiteUtilBase removeFavorites."); @@ -93,149 +93,155 @@ public List<RssItem> getRssDataItems(String fsUrl){ - XmlDocument doc = new XmlDocument(); - XmlReaderSettings settings = new XmlReaderSettings(); - settings.ProhibitDtd = false; - //doc.Load(XmlReader.Create(fsUrl,settings)); - - WebClient client =new WebClient(); - String xml = client.DownloadString(fsUrl); - doc.LoadXml(xml); - XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); - expr.AddNamespace("media", "http://search.yahoo.com/mrss"); - expr.AddNamespace("exInfo","http://www.gametrailers.com/rssexplained.php"); - //Create the root XmlNode and generate an XmlNodeList from it. - XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); - XmlNodeList nodeList; - nodeList = root.SelectNodes("//rss/channel/item"); - //XmlAttributeCollection ac; List<RssItem> loRssItems = new List<RssItem>(); - RssItem loRssItem; - //GUIListItem loListItem; - MediaContent loMediaContent; - int itemCount = 0; - foreach (XmlNode chileNode in nodeList) - { - if(itemCount>=100){ - break; - } - itemCount++; - loRssItem = new RssItem(); - - for (int i = 0; i < chileNode.ChildNodes.Count; i++) + try{ + XmlDocument doc = new XmlDocument(); + XmlReaderSettings settings = new XmlReaderSettings(); + settings.ProhibitDtd = false; + //doc.Load(XmlReader.Create(fsUrl,settings)); + + WebClient client =new WebClient(); + String xml = client.DownloadString(fsUrl); + doc.LoadXml(xml); + XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); + expr.AddNamespace("media", "http://search.yahoo.com/mrss"); + expr.AddNamespace("exInfo","http://www.gametrailers.com/rssexplained.php"); + //Create the root XmlNode and generate an XmlNodeList from it. + XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//rss/channel/item"); + //XmlAttributeCollection ac; + + RssItem loRssItem; + //GUIListItem loListItem; + MediaContent loMediaContent; + int itemCount = 0; + foreach (XmlNode chileNode in nodeList) { - XmlNode n = chileNode.ChildNodes[i]; + if(itemCount>=100){ + break; + } + itemCount++; + loRssItem = new RssItem(); - switch (n.Name) + for (int i = 0; i < chileNode.ChildNodes.Count; i++) { - - case "title": - loRssItem.title = n.InnerText; - break; - case "link": - loRssItem.link = n.InnerText; - break; - case "guid": - loRssItem.guid = n.InnerText; - break; - case "pubDate": - loRssItem.pubDate = n.InnerText; - break; - case "description": - loRssItem.description = n.InnerText; - break; - case "author": - loRssItem.author = n.InnerText; - break; - case "exInfo:image": - loRssItem.exInfoImage = n.InnerText; - break; - case "media:group": - - for (int j = 0; j < n.ChildNodes.Count; j++) - { - XmlNode nin = n.ChildNodes[j]; - switch (nin.Name) + XmlNode n = chileNode.ChildNodes[i]; + + switch (n.Name) + { + + case "title": + loRssItem.title = n.InnerText; + break; + case "link": + loRssItem.link = n.InnerText; + break; + case "guid": + loRssItem.guid = n.InnerText; + break; + case "pubDate": + loRssItem.pubDate = n.InnerText; + break; + case "description": + loRssItem.description = n.InnerText; + break; + case "author": + loRssItem.author = n.InnerText; + break; + case "exInfo:image": + loRssItem.exInfoImage = n.InnerText; + break; + case "media:group": + + for (int j = 0; j < n.ChildNodes.Count; j++) { - - case "media:content": - loMediaContent = new MediaContent(); - try{ - loMediaContent.url = nin.Attributes["url"].Value; - loMediaContent.type = nin.Attributes["type"].Value; - loMediaContent.medium = nin.Attributes["medium"].Value; - loMediaContent.duration = nin.Attributes["duration"].Value; - loMediaContent.height = nin.Attributes["height"].Value; - loMediaContent.width = nin.Attributes["width"].Value; - }catch(Exception){}; - loRssItem.contentList.Add(loMediaContent); - break; - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = nin.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = nin.InnerText; - break; - + XmlNode nin = n.ChildNodes[j]; + switch (nin.Name) + { + + case "media:content": + loMediaContent = new MediaContent(); + try{ + loMediaContent.url = nin.Attributes["url"].Value; + loMediaContent.type = nin.Attributes["type"].Value; + loMediaContent.medium = nin.Attributes["medium"].Value; + loMediaContent.duration = nin.Attributes["duration"].Value; + loMediaContent.height = nin.Attributes["height"].Value; + loMediaContent.width = nin.Attributes["width"].Value; + }catch(Exception){}; + loRssItem.contentList.Add(loMediaContent); + break; + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = nin.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = nin.InnerText; + break; + + } } - } - break; - case "media:content": - loMediaContent = new MediaContent(); - loMediaContent.url = n.Attributes["url"].Value; - loMediaContent.type = n.Attributes["type"].Value; - loMediaContent.medium = n.Attributes["medium"].Value; - loMediaContent.duration = n.Attributes["duration"].Value; - loMediaContent.height = n.Attributes["height"].Value; - loMediaContent.width = n.Attributes["width"].Value; - loRssItem.contentList.Add(loMediaContent); - for (int j = 0; j < n.ChildNodes.Count; j++) - { - XmlNode nin = n.ChildNodes[j]; - - switch (nin.Name) + break; + case "media:content": + loMediaContent = new MediaContent(); + loMediaContent.url = n.Attributes["url"].Value; + loMediaContent.type = n.Attributes["type"].Value; + loMediaContent.medium = n.Attributes["medium"].Value; + loMediaContent.duration = n.Attributes["duration"].Value; + loMediaContent.height = n.Attributes["height"].Value; + loMediaContent.width = n.Attributes["width"].Value; + loRssItem.contentList.Add(loMediaContent); + for (int j = 0; j < n.ChildNodes.Count; j++) { - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = nin.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = nin.InnerText; - break; - + XmlNode nin = n.ChildNodes[j]; + + switch (nin.Name) + { + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = nin.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = nin.InnerText; + break; + + } } - } - break; - case "media:description": - loRssItem.mediaDescription = n.InnerText; - break; - case "media:thumbnail": - loRssItem.mediaThumbnail = n.Attributes["url"].Value; - break; - case "media:title": - loRssItem.mediaTitle = n.InnerText; - break; - case "enclosure": - loRssItem.enclosure = n.Attributes["url"].Value; - if(n.Attributes["duration"]!=null){ - loRssItem.enclosureDuration = n.Attributes["duration"].Value; - } - - break; - case "media:category": - loRssItem.mediaCategory = n.InnerText; - break; - default: - break; + break; + case "media:description": + loRssItem.mediaDescription = n.InnerText; + break; + case "media:thumbnail": + loRssItem.mediaThumbnail = n.Attributes["url"].Value; + break; + case "media:title": + loRssItem.mediaTitle = n.InnerText; + break; + case "enclosure": + loRssItem.enclosure = n.Attributes["url"].Value; + if(n.Attributes["duration"]!=null){ + loRssItem.enclosureDuration = n.Attributes["duration"].Value; + } + + break; + case "media:category": + loRssItem.mediaCategory = n.InnerText; + break; + default: + break; + } } + loRssItems.Add(loRssItem); } - loRssItems.Add(loRssItem); - } + }catch(Exception e){ + Log.Error(e); + } + return loRssItems; } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Stage6Util.cs 2007-08-24 03:45:27 UTC (rev 862) @@ -33,7 +33,7 @@ } protected override String getUrl(String fsId) { - return fsId; + return fsId+"&txe=.avi"; } public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) { Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos.sln =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos.sln 2007-08-23 15:02:52 UTC (rev 861) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos.sln 2007-08-24 03:45:27 UTC (rev 862) @@ -1,7 +1,7 @@ - + Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 -# SharpDevelop 2.1.0.2429 +# SharpDevelop 2.2.0.2595 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnlineVideos", "OnlineVideos\OnlineVideos.csproj", "{E0D9D390-CDD6-4B98-86F3-6EB04A958882}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Runner", "OnlineVideos\Runner.csproj", "{EFABB07B-B050-45AD-A93F-C5047F15512F}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <gre...@us...> - 2008-03-14 23:58:02
|
Revision: 1464 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=1464&view=rev Author: gregmac45 Date: 2008-03-14 16:57:59 -0700 (Fri, 14 Mar 2008) Log Message: ----------- Latest source Modified Paths: -------------- trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/CbsUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/CnnUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/SiteUtilFactory.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/YouTubeUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos.sln Added Paths: ----------- trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/CbsNews.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/DownloadedVideoUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/FavoriteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/MyVideodeUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/RocketboomUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/SoapBoxUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/VeohUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Sites/YahooMusicVideoUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/Util/ trunk/plugins/OnlineVideos/Source/OnlineVideos/Util/YahooUtil.cs Removed Paths: ------------- trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteVideo.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/MyVideodeUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/RocketboomUtil.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs trunk/plugins/OnlineVideos/Source/OnlineVideos/SoapBoxUtil.cs Modified: trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/FLV Player/MyFlashPlayer.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -5,6 +5,7 @@ using AxShockwaveFlashObjects; using MediaPortal.Player; using MediaPortal.GUI.Library; +using MediaPortal.Configuration; using MediaPortal.Utils; using System.Xml; @@ -100,7 +101,7 @@ { FlvControl = new FlashControl(); FlvControl.Player.FlashCall += new _IShockwaveFlashEvents_FlashCallEventHandler(OnFlashCall); - FlvControl.Player.LoadMovie(0, System.IO.Directory.GetCurrentDirectory()+"\\player.swf"); + FlvControl.Player.LoadMovie(0, Config.GetFile(Config.Dir.Config,"player.swf")); //FlvControl.Player.Movie = System.IO.Directory.GetCurrentDirectory()+"\\player.swf"; FlvControl.Player.FlashVars = String.Format("&file={0}&autostart=true&enablejs=true&backcolor=0x000000&frontcolor=0xCCCCCC&showicons=false&showvolume=false&showdigits=false&displayheight={1}&allowfullscreen=true",strFile.Replace("&","%26"),9999); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.Designer.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -316,7 +316,6 @@ // // chkEnabled // - this.chkEnabled.Enabled = false; this.chkEnabled.Location = new System.Drawing.Point(132, 19); this.chkEnabled.Name = "chkEnabled"; this.chkEnabled.Size = new System.Drawing.Size(104, 24); Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Configuration.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -44,6 +44,7 @@ public void Configuration_Load(object sender, EventArgs e){ OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); txtThumbLoc.Text = settings.msThumbLocation; + txtDownloadDir.Text = settings.msDownloadDir; String lsFilterList = ""; String [] lsFilterArray = settings.msFilterArray; @@ -224,10 +225,11 @@ String [] lsFilterArray = lsFilter.Split(new char[] { ',' }); settings.msFilterArray = lsFilterArray; settings.msThumbLocation = txtThumbLoc.Text; + Log.Info("OnlineVideo Configuration - download Dir:" + txtDownloadDir.Text); settings.msDownloadDir = txtDownloadDir.Text; settings.AppleTrailerSize = (ITMSClient.TrailerSize) cmbTrailerSize.SelectedItem; settings.mbForceMPlayer = mplayerUse.Checked; - Log.Write("force mplayer={0}",settings.mbForceMPlayer); + Log.Info("force mplayer={0}",settings.mbForceMPlayer); settings.moSiteList.Clear(); foreach(GUIOnlineVideos.SiteSettings site in moSiteList){ settings.moSiteList.Add(site.id,site); Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/DownloadedVideoUtil.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,54 +0,0 @@ -using System; -using MediaPortal.GUI.Library; -using System.Text.RegularExpressions; -using System.IO; -using System.Text; -using MediaPortal.Player; -using System.Collections.Generic; -//using MediaPortal.Utils.Services; -using MediaPortal.GUI.View ; -using MediaPortal.Dialogs; -using MediaPortal.Util; -using System.Xml; -using System.Xml.XPath; -using System.ComponentModel; -using System.Threading; - - - -namespace OnlineVideos -{ - public class DownloadedVideoUtil:SiteUtilBase - { - public override string getSiteId() - { - return "99"; - } - - protected override String getUrl(String fsId) - { - - return fsId; - } - public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) - { - List<GUIOnlineVideos.VideoInfo>loVideoInfoList = new List<GUIOnlineVideos.VideoInfo>(); - string[]loVideoList = Directory.GetFiles(fsUrl); - - - GUIOnlineVideos.VideoInfo loVideoInfo; - foreach (String lsVideo in loVideoList) - { - if(isPossibleVideo(lsVideo)){ - loVideoInfo = new GUIOnlineVideos.VideoInfo(); - loVideoInfo.VideoUrl = lsVideo; - - loVideoInfo.Title = Utils.GetFilename(lsVideo); - loVideoInfoList.Add(loVideoInfo); - } - } - return loVideoInfoList; - } - - } -} Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteUtil.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,99 +0,0 @@ -/* - * Created by SharpDevelop. - * User: GZamor1 - * Date: 8/16/2007 - * Time: 4:04 PM - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; -using MediaPortal.GUI.Library; -using System.Text.RegularExpressions; -using System.IO; -using System.Text; -using MediaPortal.Player; -using System.Collections.Generic; -//using MediaPortal.Utils.Services; -using MediaPortal.GUI.View ; -using MediaPortal.Dialogs; -using MediaPortal.Util; -using System.Xml; -using System.Xml.XPath; -using System.ComponentModel; -using System.Threading; -using OnlineVideos.Database; - -namespace OnlineVideos -{ - /// <summary> - /// Description of FavoriteUtil. - /// </summary> - public class FavoriteUtil:SiteUtilBase - { - public FavoriteUtil() - { - } - - public override string getSiteId() - { - return "100"; - } - public override string getUrl(OnlineVideos.GUIOnlineVideos.VideoInfo video, OnlineVideos.GUIOnlineVideos.SiteSettings foSite) - { - - GUIOnlineVideos.SiteSettings loSite = OnlineVideoSettings.getInstance().moSiteList[video.SiteID]; - return SiteUtilFactory.getSiteUtil(video.SiteID).getUrl(video,loSite);; - } - public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) - { - fsUrl = fsUrl.Substring(4); - FavoritesDatabase db = FavoritesDatabase.getInstance(); - List<GUIOnlineVideos.VideoInfo> loVideoList; - if(String.IsNullOrEmpty(fsUrl)){ - loVideoList = db.getAllFavoriteVideos(); - }else if(fsUrl.StartsWith("%")){ - fsUrl = fsUrl.Substring(1); - loVideoList = db.searchFavoriteVideos(fsUrl); - }else{ - loVideoList = db.getSiteFavoriteVideos(fsUrl); - } - //GUIOnlineVideos.VideoInfo video; - - - return loVideoList; - } - public override List<OnlineVideos.GUIOnlineVideos.RssLink> getDynamicCategories(string lsUrl) - { - GUIOnlineVideos.RssLink all = new GUIOnlineVideos.RssLink(); - all.name = "All"; - all.url = "fav:"; - List<OnlineVideos.GUIOnlineVideos.RssLink> cats = new List<OnlineVideos.GUIOnlineVideos.RssLink>(); - cats.Add(all); - - FavoritesDatabase db = FavoritesDatabase.getInstance(); - string [] lsSiteIds = db.getSiteIDs(); - Dictionary <String, GUIOnlineVideos.SiteSettings> loSiteList = OnlineVideoSettings.getInstance().moSiteList; - GUIOnlineVideos.SiteSettings loSite; - GUIOnlineVideos.RssLink cat; - foreach(string lsSiteId in lsSiteIds){ - loSite = loSiteList[lsSiteId]; - cat = new GUIOnlineVideos.RssLink(); - cat.name = loSite.name+"-Favorites"; - cat.url = "fav:"+loSite.id; - cats.Add(cat); - - } - cat = new GUIOnlineVideos.RssLink(); - cat.name = "Search-Favorites"; - cat.url = "fav:%{0}"; - cats.Add(cat); - - //SiteUtilFactory.getSiteUtil( - - return cats; - } - - } - -} Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteVideo.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteVideo.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/FavoriteVideo.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,23 +0,0 @@ -/* - * Created by SharpDevelop. - * User: GZamor1 - * Date: 8/16/2007 - * Time: 4:27 PM - * - * To change this template use Tools | Options | Coding | Edit Standard Headers. - */ - -using System; - -namespace OnlineVideos -{ - /// <summary> - /// Description of FavoriteVideo. - /// </summary> - public class FavoriteVideo - { - public FavoriteVideo() - { - } - } -} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/GUIOnlineVideos.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -257,21 +257,31 @@ GUIListItem loListItem = facadeView.SelectedListItem; GUIDialogMenu dlgSel = (GUIDialogMenu)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_MENU); dlgSel.Reset(); + //bool downloadDirSet = false; + + if (dlgSel != null) { - if(String.IsNullOrEmpty(OnlineVideoSettings.getInstance().msDownloadDir)==false){ - dlgSel.Add("Save"); // Save - } - //Log.Info("msSelectedCategoryValue = "+msSelectedCategoryValue); - if(msSelectedCategoryValue.StartsWith("fav:") ==false){ - dlgSel.Add("Add to favorites"); - } - else{ - dlgSel.Add("Remove from favorites"); - } + dlgSel.Add("Play All"); + + if (msSelectedCategoryValue.StartsWith("fav:") == false) + { + dlgSel.Add("Add to favorites"); + } + else + { + dlgSel.Add("Remove from favorites"); + } + if(msSelectedSiteId=="1"){ dlgSel.Add("Related Videos"); // Related Videos } + if (String.IsNullOrEmpty(OnlineVideoSettings.getInstance().msDownloadDir) == false) + { + dlgSel.Add("Save"); // Save + //downloadDirSet = true; + } + //if(isSiteFavoriteEnabled()){ //} @@ -288,42 +298,24 @@ //Log.Info("Selected id {0}",liSelectedIdx); switch(liSelectedIdx){ case 1: - if(String.IsNullOrEmpty(OnlineVideoSettings.getInstance().msDownloadDir)==false){ - SaveVideo(loSelectedVideo); - - break; - }else{ - goto case 2; - } - case 2: - SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); - SiteSettings loSite = moSiteList [msSelectedSiteId]; - if(msSelectedCategoryValue.StartsWith("fav:") == false){ - //siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); - Log.Info("Received request to add video to favorites."); - - siteUtil.AddFavorite(loSelectedVideo,msSelectedSiteId); - - - }else{ - siteUtil.RemoveFavorite(loSelectedVideo); - DisplayVideos(true); - } + playAll(); + break; + case 2: + AddOrRemoveFavorite(loSelectedVideo); break; case 3: - //Log.Info("Getting related videos on {0} using tags:{1}",SiteUtilFactory.getSiteUtil(msSelectedSiteId),moCurrentVideoList[liSelected].Tags); - SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); - //Log.Info("VideoList before:"); - //foreach(VideoInfo video in moCurrentVideoList){ - //Log.Info(video.Title); - //} - moCurrentVideoList = site.getRelatedVideos(moCurrentVideoList[liSelected].VideoUrl); - //Log.Info("VideoList after:"); - //foreach(VideoInfo video in moCurrentVideoList){ - // Log.Info(video.Title); - //} - DisplayVideos(false); - break; + if (msSelectedSiteId == "1") + { + getRelatedVideos(loSelectedVideo); + } + else + { + SaveVideo(loSelectedVideo); + } + break; + case 4: + SaveVideo(loSelectedVideo); + break; } base.OnShowContextMenu(); @@ -412,12 +404,14 @@ } else if (control == btnNext) { + moCurrentVideoList = null; moCurrentVideoList = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getNextPageVideos(); DisplayVideos(false); UpdateViewState(); } else if (control == btnPrevious) { + moCurrentVideoList = null; moCurrentVideoList = SiteUtilFactory.getSiteUtil(msSelectedSiteId).getPreviousPageVideos(); DisplayVideos(false); UpdateViewState(); @@ -888,12 +882,12 @@ } }else{ String lsUrl = loSite.getUrl(foListItem, loSiteSettings); - if (settings.mbForceMPlayer) + if (settings.mbForceMPlayer && !lsUrl.EndsWith(".wmv")) { lsUrl = lsUrl + OnlineVideoSettings.MPLAYER_EXT; } if(lsUrl.EndsWith(".wmv")){ - if(g_Player.PlayAudioStream(lsUrl)) + if(g_Player.PlayVideoStream(lsUrl)) playing = true; }else{ if(g_Player.Play(lsUrl)) @@ -924,6 +918,64 @@ } */ } + private void playAll() + { + bool playing = false; + PlayList videoList = PlayListPlayer.SingletonPlayer.GetPlaylist(PlayListType.PLAYLIST_VIDEO_TEMP); + videoList.Clear(); + PlayListItem item; + OnlineVideoSettings settings = OnlineVideoSettings.getInstance(); + String lsUrl; + SiteSettings loSiteSettings = moSiteList[msSelectedSiteId]; + SiteUtilBase loSite = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + List<VideoInfo> loVideoList; + if (msSelectedSiteId == "15") + { + loVideoList = moCurrentTrailerList; + } + else + { + loVideoList = moCurrentVideoList; + } + bool firstAdded = false; + foreach (VideoInfo loVideo in loVideoList) + { + + lsUrl = loSite.getUrl(loVideo, loSiteSettings); + + if (settings.mbForceMPlayer && !loVideo.VideoUrl.EndsWith(".wmv") ) + { + + item = new PlayListItem("", lsUrl + OnlineVideoSettings.MPLAYER_EXT); + } + else + { + item = new PlayListItem("", lsUrl); + } + //item.Type = PlayListType.PLAYLIST_VIDEO_TEMP; + videoList.Add(item); + Log.Info("GUIOnlineVideos.playAll:Added {0} to playlist", loVideo.Title); + if (!firstAdded) + { + firstAdded = true; + PlayListPlayer.SingletonPlayer.CurrentPlaylistType = PlayListType.PLAYLIST_VIDEO_TEMP; + if (PlayListPlayer.SingletonPlayer.Play(0)) + { + playing = true; + } + if (playing) + { + Log.Info("GUIOnlineVideos.playAll:Playing first video."); + GUIGraphicsContext.IsFullScreenVideo = true; + GUIWindowManager.ActivateWindow((int)GUIWindow.Window.WINDOW_FULLSCREEN_VIDEO); + } + + } + + } + + + } private void SaveVideo(VideoInfo foListItem) { SiteSettings loSite = moSiteList[msSelectedSiteId]; @@ -933,7 +985,12 @@ loClient.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)"); loClient.DownloadFileCompleted += new AsyncCompletedEventHandler(DownloadFileCompleted); String lsExtension = System.IO.Path.GetExtension(lsUrl); - String lsFileName = OnlineVideoSettings.getInstance().msDownloadDir+foListItem.Title+"_"+foListItem.Title2+lsExtension; + String downloadDir = OnlineVideoSettings.getInstance().msDownloadDir; + if (!downloadDir.EndsWith("/") || !downloadDir.EndsWith("\\")) + { + downloadDir+="/"; + } + String lsFileName = downloadDir+foListItem.Title+"_"+foListItem.Title2+lsExtension; loClient.DownloadFileAsync(new Uri(lsUrl), lsFileName, foListItem.Title); } @@ -1243,6 +1300,31 @@ //Log.Info(foVideo.Description); } } + private void AddOrRemoveFavorite(VideoInfo loSelectedVideo) + { + SiteUtilBase siteUtil = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + SiteSettings loSite = moSiteList[msSelectedSiteId]; + if (msSelectedCategoryValue.StartsWith("fav:") == false) + { + //siteUtil.addFavorite(moCurrentVideoList[liSelected].VideoUrl,loSite.username,loSite.password); + Log.Info("Received request to add video to favorites."); + + siteUtil.AddFavorite(loSelectedVideo, msSelectedSiteId); + + + } + else + { + siteUtil.RemoveFavorite(loSelectedVideo); + DisplayVideos(true); + } + } + private void getRelatedVideos(VideoInfo loSelectedVideo) + { + SiteUtilBase site = SiteUtilFactory.getSiteUtil(msSelectedSiteId); + moCurrentVideoList = site.getRelatedVideos(loSelectedVideo.VideoUrl); + DisplayVideos(false); + } #endregion } Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/ItunesTrailerUtil.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,203 +0,0 @@ -using System; -using MediaPortal.GUI.Library; -using System.Text.RegularExpressions; -using System.Net; -using System.Text; -using System.ComponentModel; -using MediaPortal.Player; -using System.Collections.Generic; -//using MediaPortal.Utils.Services; -using MediaPortal.Dialogs; -//using Rss; -using MediaPortal.GUI.View; -using ITMSClient; -using HDTrailerPlugin; - - - -namespace OnlineVideos -{ - public class ItunesTrailerUtil : SiteUtilBase - { - public override string getSiteId() - { - return "15"; - } - public override bool hasMultipleVideos() - { - return true; - } - public override List<GUIOnlineVideos.VideoInfo> getVideoList(String fsUrl) - { - List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); - if(fsUrl.StartsWith("%")){ - if(fsUrl.Length == 1){ - loListItems = getAllTrailers(); - loListItems.Sort(delegate(GUIOnlineVideos.VideoInfo v1, GUIOnlineVideos.VideoInfo v2) { return v1.Title.CompareTo(v2.Title); }); - }else{ - fsUrl = fsUrl.Substring(1); - loListItems = search(fsUrl); - } - }else{ - DownloadTrailers(fsUrl); - - foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) - { - loListItems.Add(loadVideoInfo(trailer)); - } - } - return loListItems; - - } - public override List<OnlineVideos.GUIOnlineVideos.VideoInfo> getOtherVideoList(OnlineVideos.GUIOnlineVideos.VideoInfo video) - { - List<OnlineVideos.GUIOnlineVideos.VideoInfo> videoList = new List<OnlineVideos.GUIOnlineVideos.VideoInfo>(); - TrailerInfo trailer = (TrailerInfo)video.Other; - trailer = AppleTrailers.GetTrailerUrls(trailer); - GUIOnlineVideos.VideoInfo newVideo; - foreach (String name in trailer.trailers.Keys){ - newVideo = loadVideoInfo(trailer); - newVideo.Title2 = name; - newVideo.VideoUrl = trailer.trailers[name]; - Log.Info("added video url={0}", newVideo.VideoUrl); - videoList.Add(newVideo); - } - return videoList; - } - public override String getUrl(GUIOnlineVideos.VideoInfo video,GUIOnlineVideos.SiteSettings foSite) - { - if(video.VideoUrl.EndsWith(".mov")){ - return video.VideoUrl; - } - return getTrailerUrl(video); - } - private String getTrailerUrl(GUIOnlineVideos.VideoInfo video){ - TrailerInfo trailer = (TrailerInfo)video.Other; - Log.Info("requesting to get url for " + video.VideoUrl); - trailer.Url = new Uri("http://movies.apple.com" + video.VideoUrl); - Log.Info("Trailer quality set to {0}", OnlineVideoSettings.getInstance().AppleTrailerSize); - trailer = AppleTrailers.ProcessTrailer(trailer,OnlineVideoSettings.getInstance().AppleTrailerSize); - - return trailer.TrailerStreamCollection[0].Uri.ToString(); - } - public List<GUIOnlineVideos.VideoInfo> getAllTrailers(){ - - Dictionary<string, GUIOnlineVideos.RssLink> loRssList= OnlineVideoSettings.getInstance().moSiteList[getSiteId()].RssList; - List<GUIOnlineVideos.VideoInfo> loListItems = new List<GUIOnlineVideos.VideoInfo>(); - foreach(GUIOnlineVideos.RssLink link in loRssList.Values){ - - if(link.url.StartsWith("%")){ - continue; - } - - - DownloadTrailers(link.url); - Dictionary<string, string> loTrailersFound = new Dictionary<string,string>(); - foreach (ITMSClient.TrailerInfo trailer in HDTrailerPlugin.AppleTrailers.trailers) - { - - if(loTrailersFound.ContainsKey(trailer.Title) == false){ - loTrailersFound.Add(trailer.Title.ToUpper(), ""); - - //loItem.Length = trailer.. - loListItems.Add(loadVideoInfo(trailer)); - } - - } - - - } - return loListItems; - - } - private List<GUIOnlineVideos.VideoInfo> search(String fsQuery){ - fsQuery = fsQuery.ToUpper(); - - List<GUIOnlineVideos.VideoInfo>loAllTrailers = getAllTrailers(); - List<GUIOnlineVideos.VideoInfo>loSearchResult = loAllTrailers.FindAll(delegate(GUIOnlineVideos.VideoInfo v1) { return v1.Title.ToUpper().Contains(fsQuery);}); - - return loSearchResult; - } - private void DownloadTrailers(String fsLink){ - - //Log.Info("getting trailers from url:"+fsLink.url); - BackgroundWorker worker = new BackgroundWorker(); - worker.DoWork += new DoWorkEventHandler(HDTrailerPlugin.AppleTrailers.GetAppleTrailersRSS); - AppleTrailers._workerCompleted = false; - - worker.RunWorkerAsync(fsLink); - DateTime startTime = DateTime.Now; - TimeSpan duration = new TimeSpan(); - //using (WaitCursor cursor = new WaitCursor()) - { - - while (HDTrailerPlugin.AppleTrailers._workerCompleted == false && duration.TotalSeconds < 10){ - //Log.Info("donwload trailer duration = {0} seconds",duration.TotalSeconds); - //GUIWindowManager.Process(); - duration = DateTime.Now - startTime;; - - } - } - - //Log.Info("finished getting trailers from url:"+fsLink.url); - } - private GUIOnlineVideos.VideoInfo loadVideoInfo(TrailerInfo trailer){ - GUIOnlineVideos.VideoInfo newVideo = new GUIOnlineVideos.VideoInfo(); - newVideo.Title = trailer.Title; - newVideo.VideoUrl = trailer.Title; - newVideo.Description = trailer.Overview; - if(trailer.PosterUrl!=null){ - newVideo.ImageUrl = trailer.PosterUrl.ToString(); - } - newVideo.Other = trailer; - return newVideo; - - } - public override bool hasNextPage() - { - if (AppleTrailers.currentPage == null || AppleTrailers.currentPage.NextPageUri == null) - { - //Log.Info("current page is null or next page uri is null"); - return false; - } - //Log.Info("{0}",AppleTrailers.currentPage.NextPageUri); - Log.Info(AppleTrailers.currentPage.NextPageUri.ToString()); - return String.IsNullOrEmpty(AppleTrailers.currentPage.NextPageUri.ToString()) == false; - } - public override List<GUIOnlineVideos.VideoInfo> getNextPageVideos() - { - List<GUIOnlineVideos.VideoInfo> trailerList = new List<GUIOnlineVideos.VideoInfo>(); - if (hasNextPage()) - { - trailerList = getVideoList(AppleTrailers.currentPage.NextPageUri.ToString()); - } - return trailerList; - } - public override List<GUIOnlineVideos.VideoInfo> getPreviousPageVideos() - { - List<GUIOnlineVideos.VideoInfo> trailerList = new List<GUIOnlineVideos.VideoInfo>(); - if (hasPreviousPage()) - { - trailerList = getVideoList(AppleTrailers.currentPage.BackPageUri.ToString()); - } - return trailerList; - - } - public override bool hasPreviousPage() - { - if (AppleTrailers.currentPage == null || AppleTrailers.currentPage.BackPageUri == null) - { - return false; - } - return String.IsNullOrEmpty(AppleTrailers.currentPage.BackPageUri.ToString()) == false; - } - public override void AddFavorite(OnlineVideos.GUIOnlineVideos.VideoInfo foVideo, string fsSiteId) - { - foVideo.VideoUrl = getTrailerUrl(foVideo); - //TrailerInfo info = (TrailerInfo)foVideo.Other; - foVideo.Title = " - "+foVideo.Title2; - - base.AddFavorite(foVideo, fsSiteId); - } - } -} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Main.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -17,12 +17,83 @@ using System.Threading; using System.Reflection; using OnlineVideos; +using System.Text.RegularExpressions; namespace Runner { class MainClass { public static void Main(string[] args) { + Console.WriteLine("Starting runner"); + //Console.WriteLine("CNN video url:" +Regex.Split("/video/podcasts/incaseyoumissed/site/2008/01/28/in.case.you.missed.it.01.28.cnn", "/video")[1]); + + List<OnlineVideos.GUIOnlineVideos.VideoInfo> videoList = new List<OnlineVideos.GUIOnlineVideos.VideoInfo>(); + XmlTextReader r = new XmlTextReader("http://www.cnn.com/.element/ssi/www/auto/2.0/video/xml/by_section_us.xml?0.8373572623494244"); + //XmlTextReader r = new XmlTextReader(fsUrl); + GUIOnlineVideos.VideoInfo video = null; + XmlDocument doc = new XmlDocument(); + doc.Load(r); + XmlNode root = doc.SelectSingleNode("//cnn_video/video"); + XmlNodeList nodeList; + nodeList = root.SelectNodes("//cnn_video/video"); + //XmlAttributeCollection ac; + foreach (XmlNode child in nodeList) + { + video = new GUIOnlineVideos.VideoInfo(); + + for (int i = 0; i < child.ChildNodes.Count; i++) + { + XmlNode n = child.ChildNodes[i]; + + + switch (n.Name) + { + + case "video_id": + video.VideoUrl = Regex.Split(n.InnerText, "/video")[1]; + break; + case "image_url": + video.ImageUrl = n.InnerText; + break; + case "tease_txt": + video.Title = n.InnerText; + break; + case "vid_duration": + video.Length = n.InnerText; + break; + + + } + + } + videoList.Add(video); + Console.WriteLine(video); + } + + //WebClient client = new WebClient(); + //String lsHtml = client.DownloadString("http://feeds.cbsnews.com/~r/CBSNewsVideo/~3/155079543/main500251.shtml"); + //Console.WriteLine(Regex.Split("http://www.cbsnews.com/sections/i_video/main500251.shtml?source=RSS&attr=CBSNewsVideo_3249653&channel=i_video&id=3249653n","id=")[1]); + //Console.WriteLine(client.ResponseHeaders[System.Net.HttpResponseHeader.Location]); + //Console.WriteLine(lsHtml); + //XmlTextReader r = new XmlTextReader("http://www.cbs.com/innertube/xmlProxy.php?type=videoList&id=124991"); + //while(r.Read()){ + // Console.WriteLine(r["show"]); + //} + /* + }else if (r.NodeType == XmlNodeType.Element && r.Name == "image_url"){ + video.ImageUrl = r.ReadInnerXml(); + }else if (r.NodeType == XmlNodeType.Element && r.Name == "tease_txt"){ + video.Title = r.ReadInnerXml(); + }else if (r.NodeType == XmlNodeType.Element && r.Name == "vid_duration"){ + video.Length = r.ReadInnerXml(); + + }else if(r.NodeType == XmlNodeType.EndElement && r.Name == "video"){ + + Console.WriteLine(video.ToString()); + } + */ + + /* //string c = "x3a"; string url ="http://soapbox.msn.com/SoapboxService.fpp?cnmn=Soapbox.Services.Fireant.SoapboxService.loadvideo&ptid=&a=&cn=Soapbox.Services.Fireant.SoapboxService&d=%22faaf0e45-b19a-42bc-9952-b3580f8aad15%22%2Cfalse%2CSystem.Collections.Hashtable%3A%7B%22appServiceID%22%3ASystem.String%3A%22fc2e33669f144ecb813c44aebf9b0d14%22%7D&mn=loadvideo&v=1"; WebClient client = new WebClient(); @@ -37,89 +108,93 @@ doc.Load(reader); - - - - //SiteUtilBase loUtil = new YouTubeUtil(); - //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://youtube.com/rss/global/top_rated.rss"); - - ItunesTrailerUtil loUtil = new ItunesTrailerUtil(); - //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml"); - - //loUtil.getUrl(loList[0],null); - //loList =loUtil.getOtherVideoList(loList[9]); - //loUtil.getUrl(loList[8],null); - //loUtil.getUrl(loList[loList.Count-1],null); - - /* + */ + + + + //YouTubeUtil loUtil = new YouTubeUtil(); + //List<GUIOnlineVideos.VideoInfo> loList = loUtil.parseGData("http://gdata.youtube.com/feeds/api/videos"); + + //ItunesTrailerUtil loUtil = new ItunesTrailerUtil(); + //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://movies.apple.com/moviesxml/s/dreamworks/index_1.xml"); + + //loUtil.getUrl(loList[0],null); + //loList =loUtil.getOtherVideoList(loList[9]); + //loUtil.getUrl(loList[8],null); + //loUtil.getUrl(loList[loList.Count-1],null); + + /* SiteUtilBase loUtil = new BlipTvUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://blip.tv/?1=1&search=soccer;page=1;s=posts&skin=rss"); - */ - /* + */ + /* SiteUtilBase loUtil = new VidiLifeUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://rss.vidilife.com/rss.aspx"); - */ - /* + */ + /* SiteUtilBase loUtil = new SoapBoxUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://soapbox.msn.com/rss.aspx?listId=mostpopular&categoryId=8118b646-92c6-4051-a1eb-40ef4ee49ec1"); - */ - /* + */ + /* SiteUtilBase loUtil = new GameTrailersUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://www.gametrailers.com/rss/newest.xml"); - */ - /* + */ + /* AbcUtil loUtil = new AbcUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://ll.static.abc.com/streaming/s/catalog?aff=&isIE=true"); - */ - /* + */ + /* SiteUtilBase loUtil = new VideoJugUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://www.videojug.com/rss"); - */ - /* + */ + /* SiteUtilBase loUtil = new BreakUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getRssData("http://rss.break.com/channel/homepage/"); - */ - /* + */ + /* SiteUtilBase loUtil = new GoogleVideoUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://video.google.com/videofeed?type=popular&num=100&output=rss"); - */ - /* + */ + /* SiteUtilBase loUtil = new GrouperUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://grouper.com/rss/media.ashx?o=0&t=1&fx=&fp=1"); - */ - - //SiteUtilBase loUtil = new MetaCafeUtil(); - //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://www.metacafe.com/rss/new_videos.rss"); - - /* + */ + + //SiteUtilBase loUtil = new MetaCafeUtil(); + //List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://www.metacafe.com/rss/new_videos.rss"); + + /* SiteUtilBase loUtil = new DailyMotionUtil(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://www.dailymotion.com/rss"); - */ - /* + */ + /* SiteUtilBase loUtil = new Stage6Util(); List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://stage6.divx.com/rss/videos/order:rating"); - */ - //Console.WriteLine(loUtil.getUrl(loList[0].VideoUrl)); - //foreach(GUIOnlineVideos.VideoInfo loVideoInfo in loList){ - //Console.WriteLine("title:{0} \nurl:{1} \nimage:{2}",loVideoInfo.Title,loVideoInfo.VideoUrl, loVideoInfo.ImageUrl); - //} - //YouTubeUtil youtube = new YouTubeUtil(); - //youtube.username = "MepoPlugin"; - //youtube.password = "mepo"; - //youtube.login(); - //http://youtube.com/watch?v=BjfbS_Kj-J0 - //youtube.removeFavorite("tNbmPCL1RCc","MepoPlugin","mepo"); - //youtube.addFavorite("BjfbS_Kj-J0","MepoPlugin","mepo"); - //List<GUIOnlineVideos.VideoInfo> loVideos = youtube.getSiteFavorites("MepoPlugin"); - //foreach(GUIOnlineVideos.VideoInfo video in loVideos){ - // Console.WriteLine(video.VideoUrl); - //} - - //Console.WriteLine("Title:{0}\n Url:{1}\n Image:{2}\n",loList[0].Title,loList[0].VideoUrl, loList[0].ImageUrl); - //Console.WriteLine("url:{0}",loUtil.getUrl(loList[0].VideoUrl)); - //Console.WriteLine("url:{0}",loUtil.getUrl("http://www.break.com/index/another_day_at_the_zoo.html")); - // Create a new XmlDocument - /* + */ + //Console.WriteLine(loUtil.getUrl(loList[0].VideoUrl)); + + SiteUtilBase loUtil = new YahooMusicVideoUtil(); + List<GUIOnlineVideos.VideoInfo> loList = loUtil.getVideoList("http://new.music.yahoo.com/videos/charts/"); + foreach(GUIOnlineVideos.VideoInfo loVideoInfo in loList){ + Console.WriteLine("title:{0} \nurl:{1} \nimage:{2}",loVideoInfo.Title,loVideoInfo.VideoUrl, loVideoInfo.ImageUrl); + } + //YouTubeUtil youtube = new YouTubeUtil(); + //youtube.username = "MepoPlugin"; + //youtube.password = "mepo"; + //youtube.login(); + //http://youtube.com/watch?v=BjfbS_Kj-J0 + //youtube.removeFavorite("tNbmPCL1RCc","MepoPlugin","mepo"); + //youtube.addFavorite("BjfbS_Kj-J0","MepoPlugin","mepo"); + //List<GUIOnlineVideos.VideoInfo> loVideos = youtube.getSiteFavorites("MepoPlugin"); + //foreach(GUIOnlineVideos.VideoInfo video in loVideos){ + // Console.WriteLine(video.VideoUrl); + //} + + //Console.WriteLine("Title:{0}\n Url:{1}\n Image:{2}\n",loList[0].Title,loList[0].VideoUrl, loList[0].ImageUrl); + //Console.WriteLine("url:{0}",loUtil.getUrl(loList[0].VideoUrl)); + //Console.WriteLine("url:{0}",loUtil.getUrl("http://www.break.com/index/another_day_at_the_zoo.html")); + // Create a new XmlDocument + /* HttpWebRequest webrequest = (HttpWebRequest)WebRequest.Create("http://www.myvideo.de/movie/15714"); webrequest.KeepAlive = false; @@ -138,14 +213,16 @@ string uri = headers["Location"]; Console.WriteLine("uri:"+uri); } - */ - //client.DownloadFile("http://www.myvideo.de/movie/15714",@"C:\myvideo.txt"); - //Console.WriteLine(download); - Console.WriteLine("done..."); - - Console.ReadKey(); - - + */ + //client.DownloadFile("http://www.myvideo.de/movie/15714",@"C:\myvideo.txt"); + //Console.WriteLine(download); + + + Console.WriteLine("done..."); + + Console.ReadKey(); + + + } } } -} Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/MyVideodeUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/MyVideodeUtil.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/MyVideodeUtil.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,132 +0,0 @@ -using System; -using MediaPortal.GUI.Library; -using System.Text.RegularExpressions; -using System.Net; -using System.Text; -using MediaPortal.Player; -using System.Collections.Generic; -//using MediaPortal.Utils.Services; -using MediaPortal.GUI.View ; -using MediaPortal.Dialogs; -using System.Xml; -using System.Xml.XPath; -using System.ComponentModel; -using System.Threading; - - - -namespace OnlineVideos -{ - public class MyVideodeUtil : SiteUtilBase - { - public override string getSiteId() - { - return "myvideo.de"; - } - - protected override String getUrl(String fsId) - { - String lsUrl = ""; - HttpWebRequest webrequest = - (HttpWebRequest)WebRequest.Create("http://www.myvideo.de/movie/15714"); - webrequest.KeepAlive = false; - webrequest.Method = "GET"; - webrequest.ContentType = "text/html"; - webrequest.AllowAutoRedirect = false; - HttpWebResponse webresponse; - webresponse = (HttpWebResponse)webrequest.GetResponse(); - WebHeaderCollection headers = webresponse.Headers; - if ((webresponse.StatusCode == HttpStatusCode.Found) || - (webresponse.StatusCode == HttpStatusCode.Redirect) || - (webresponse.StatusCode == HttpStatusCode.Moved) || - (webresponse.StatusCode == HttpStatusCode.MovedPermanently)) - { - // Get redirected uri - string lsUri = headers["Location"]; - lsUrl = Regex.Match(lsUri, "V=([^&]*)").Groups[1].Value; - } - - return lsUrl; - } - public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) - { - List<RssItem> loRssItemList = getRssDataItems(fsUrl); - List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo video; - foreach(RssItem rssItem in loRssItemList){ - video = new GUIOnlineVideos.VideoInfo(); - video.Description = rssItem.description; - video.ImageUrl = rssItem.mediaThumbnail; - video.Title = rssItem.title; - video.VideoUrl = Regex.Match(rssItem.link, "watch/([\\d]*)").Groups[1].Value; - loVideoList.Add(video); - - } - return loVideoList; - } - /* - public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) - { - - XmlDocument doc = new XmlDocument(); - //XPathDocument doc = new XPathDocument(fsUrl); - - doc.Load(XmlReader.Create(fsUrl)); - XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); - expr.AddNamespace("media", "http://search.yahoo.com/mrss"); - - //Create the root XmlNode and generate an XmlNodeList from it. - XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); - XmlNodeList nodeList; - nodeList = root.SelectNodes("//rss/channel/item"); - //RssItem loRssItem = new RssItem(); - //loRssItem. - //This loops through each node found in the nodeList and adds the - //Node data to the DataTable. - XmlAttributeCollection ac; - //List<RssItem> loRssItems = new List<RssItem>(); - List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo loRssItem; - //GUIListItem loListItem; - foreach (XmlNode chileNode in nodeList) - { - loRssItem = new GUIOnlineVideos.VideoInfo(); - - XmlNode node = chileNode.SelectSingleNode("title"); - loRssItem.Title = node.InnerText; - - //node = chileNode.SelectSingleNode("link"); - //loRssItem.link = node.InnerText; - - node = chileNode.SelectSingleNode("description"); - loRssItem.Description = node.InnerText; - - node = chileNode.SelectSingleNode("media:thumbnail[@width=\"260\"]", expr); - if (node != null) - { - ac = node.Attributes; - loRssItem.ImageUrl = ac["url"].InnerText; - } - - - node = chileNode.SelectSingleNode("guid"); - if (node != null) - { - //ac = node.Attributes; - loRssItem.VideoUrl = node.InnerText; - } - - //Log.Write(loRssItem.ToString()); - //loListItem = new GUIListItem(loRssItem.title); - //loListItem.Path = loRssItem.videoUrl; - loRssItems.Add(loRssItem); - - - } - return loRssItems; - } - - */ - - } -} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideoSettings.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -23,6 +23,9 @@ public String msThumbLocation; public String msDownloadDir; public String[] msFilterArray; + public bool mbForceMPlayer = true; + public bool mbUseVMR9 = true; + public const String MPLAYER_EXT = ".mplayer"; public Dictionary<String,GUIOnlineVideos.SiteSettings> moSiteList = new Dictionary<String, GUIOnlineVideos.SiteSettings>(); public ITMSClient.TrailerSize AppleTrailerSize = ITMSClient.TrailerSize.h640; private const String SETTINGS_FILE = "OnlineVideoSites.xml"; @@ -31,6 +34,7 @@ private const String DOWNLOAD_DIR = "downloadDir"; private const String SECTION = "onlinevideos"; private const String FILTER = "filter"; + private const String USE_MPLAYER = "useMplayer"; public static OnlineVideoSettings getInstance(){ if(instance ==null){ @@ -49,8 +53,10 @@ msThumbLocation = xmlreader.GetValueAsString(SECTION, THUMBNAIL_DIR, ""); msDownloadDir = xmlreader.GetValueAsString(SECTION, DOWNLOAD_DIR, ""); + mbForceMPlayer = xmlreader.GetValueAsBool(SECTION, USE_MPLAYER, false); String lsFilter = xmlreader.GetValueAsString(SECTION, FILTER, ""); lsTrailerSize = xmlreader.GetValueAsString(SECTION,TRAILER_SIZE,"h640"); + mbUseVMR9 = xmlreader.GetValueAsBool("general", "usevrm9forwebstreams", true); msFilterArray = lsFilter.Split(new char[] { ',' }); if (msFilterArray.Length == 1 && msFilterArray[0] == "") { @@ -69,7 +75,7 @@ XmlDocument doc = new XmlDocument(); try { - doc.Load(SETTINGS_FILE); + doc.Load(Config.GetFile(Config.Dir.Config, SETTINGS_FILE)); XmlNode root = doc.SelectSingleNode("//settings/sites/site"); XmlNodeList nodeList; @@ -146,8 +152,10 @@ { try { - using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + Log.Info("using MP config file:" + Config.GetFile(Config.Dir.Config, "MediaPortal.xml")); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) { + String lsFilterList = ""; String [] lsFilterArray = msFilterArray; if(lsFilterArray!=null){ @@ -156,18 +164,21 @@ } } if((lsFilterList == ",")==false){ + lsFilterList.Remove(lsFilterList.Length-1); xmlwriter.SetValue(SECTION, FILTER, lsFilterList); }else{ msFilterArray = null; } xmlwriter.SetValue(SECTION,THUMBNAIL_DIR,msThumbLocation); - xmlwriter.SetValue(SECTION, DOWNLOAD_DIR,msDownloadDir ); + Log.Info("OnlineVideoSettings - download Dir:" + msDownloadDir); + xmlwriter.SetValue(SECTION,DOWNLOAD_DIR,msDownloadDir ); xmlwriter.SetValue(SECTION,TRAILER_SIZE,AppleTrailerSize.ToString()); - + xmlwriter.SetValueAsBool(SECTION, USE_MPLAYER, mbForceMPlayer); + Log.Info("saveSettings force mplayer={0}", mbForceMPlayer); } Console.WriteLine(System.IO.Directory.GetCurrentDirectory()); //pick whatever filename with .xml extension - string filename = SETTINGS_FILE; + string filename = Config.GetFile(Config.Dir.Config, SETTINGS_FILE); if(System.IO.File.Exists(filename)){ System.IO.File.Delete(filename); } Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/OnlineVideos.csproj 2008-03-14 23:57:59 UTC (rev 1464) @@ -37,19 +37,17 @@ <WarningLevel>4</WarningLevel> </PropertyGroup> <ItemGroup> - <Reference Include="Core, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Core, Version=0.2.3.17915, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> + <HintPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Core.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Databases, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Databases, Version=0.2.3.17915, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Databases.DLL</HintPath> + <HintPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Databases.DLL</HintPath> <Private>False</Private> </Reference> - <Reference Include="Dialogs, Version=0.0.0.0, Culture=neutral, processorArchitecture=x86"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\..\..\..\Mediaportal\Dialogs\bin\Release\Dialogs.DLL</HintPath> + <Reference Include="Dialogs, Version=0.2.3.17915, Culture=neutral, processorArchitecture=x86"> <Private>False</Private> </Reference> <Reference Include="System"> @@ -68,9 +66,9 @@ <Reference Include="System.Xml"> <Private>False</Private> </Reference> - <Reference Include="Utils, Version=0.2.2.9991, Culture=neutral, processorArchitecture=x86"> + <Reference Include="Utils, Version=0.2.3.17915, Culture=neutral, processorArchitecture=x86"> <SpecificVersion>False</SpecificVersion> - <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> + <HintPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Utils.DLL</HintPath> <Private>False</Private> </Reference> </ItemGroup> @@ -82,38 +80,41 @@ <DependentUpon>Configuration.cs</DependentUpon> </Compile> <Compile Include="Favorites.cs" /> - <Compile Include="FavoriteUtil.cs" /> - <Compile Include="FavoriteVideo.cs" /> <Compile Include="OnlineVideoSettings.cs" /> - <Compile Include="RocketboomUtil.cs" /> - <Compile Include="MyVideodeUtil.cs" /> <Compile Include="ItunesUtils\AppleTrailers.cs" /> <Compile Include="ItunesUtils\HttpReader.cs" /> <Compile Include="ItunesUtils\ItmsContent.cs" /> <Compile Include="ItunesUtils\ItmsHelper.cs" /> - <Compile Include="ItunesTrailerUtil.cs" /> - <Compile Include="DownloadedVideoUtil.cs" /> <Compile Include="ImageDowloader.cs" /> <Compile Include="ItunesUtils\RegexParsers.cs" /> <Compile Include="Sites\AbcUtil.cs" /> <Compile Include="Sites\BlipTvUtil.cs" /> <Compile Include="Sites\BreakUtil.cs" /> + <Compile Include="Sites\CbsNews.cs" /> <Compile Include="Sites\CbsUtil.cs" /> <Compile Include="Sites\CnnUtil.cs" /> + <Compile Include="Sites\VeohUtil.cs" /> <Compile Include="Sites\DailyMotionUtil.cs" /> + <Compile Include="Sites\DownloadedVideoUtil.cs" /> + <Compile Include="Sites\FavoriteUtil.cs" /> <Compile Include="Sites\GameTrailersUtil.cs" /> <Compile Include="Sites\GenericSiteUtil.cs" /> <Compile Include="Sites\GoogleVideoUtil.cs" /> <Compile Include="Sites\GrouperUtil.cs" /> <Compile Include="Sites\GubaUtil.cs" /> + <Compile Include="Sites\ItunesTrailerUtil.cs" /> <Compile Include="Sites\LiveVideoUtil.cs" /> <Compile Include="Sites\MetaCafeUtil.cs" /> + <Compile Include="Sites\MyVideodeUtil.cs" /> + <Compile Include="Sites\RocketboomUtil.cs" /> + <Compile Include="Sites\SiteUtilBase.cs" /> <Compile Include="Sites\SiteUtilFactory.cs" /> + <Compile Include="Sites\SoapBoxUtil.cs" /> <Compile Include="Sites\Stage6Util.cs" /> <Compile Include="Sites\VideoJugUtil.cs" /> <Compile Include="Sites\VidiLifeUtil.cs" /> + <Compile Include="Sites\YahooMusicVideoUtil.cs" /> <Compile Include="Sites\YouTubeUtil.cs" /> - <Compile Include="SiteUtilBase.cs" /> <Compile Include="ItunesUtils\TrailerIndex.cs" /> <Compile Include="ItunesUtils\TrailerInfo.cs" /> <Compile Include="ItunesUtils\TrailerInfoCollection.cs" /> @@ -124,14 +125,11 @@ <CopyToOutputDirectory>Never</CopyToOutputDirectory> </Compile> <Compile Include="Properties\AssemblyInfo.cs" /> - <Compile Include="SoapBoxUtil.cs" /> + <Compile Include="Util\YahooUtil.cs" /> <EmbeddedResource Include="Configuration.resx"> <DependentUpon>Configuration.Designer.cs</DependentUpon> <SubType>Designer</SubType> </EmbeddedResource> </ItemGroup> - <ItemGroup> - <Folder Include="Sites" /> - </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> </Project> \ No newline at end of file Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/RocketboomUtil.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/RocketboomUtil.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/RocketboomUtil.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,111 +0,0 @@ -using System; -using MediaPortal.GUI.Library; -using System.Text.RegularExpressions; -using System.Net; -using System.Text; -using MediaPortal.Player; -using System.Collections.Generic; -//using MediaPortal.Utils.Services; -using MediaPortal.GUI.View ; -using MediaPortal.Dialogs; -using System.Xml; -using System.Xml.XPath; -using System.ComponentModel; -using System.Threading; - - - -namespace OnlineVideos -{ - public class RocketboomUtil : SiteUtilBase - { - public override string getSiteId() - { - return "17"; - } - - protected override String getUrl(String fsId) - { - return fsId; - } - public override List<GUIOnlineVideos.VideoInfo> getVideoList(string fsUrl) - { - List<RssItem> loRssItemList = getRssDataItems(fsUrl); - List<GUIOnlineVideos.VideoInfo> loVideoList = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo video; - foreach(RssItem rssItem in loRssItemList){ - video = new GUIOnlineVideos.VideoInfo(); - video.Description = rssItem.description; - video.Title = rssItem.title; - video.VideoUrl = rssItem.enclosure; - loVideoList.Add(video); - - } - return loVideoList; - } - /* - public List<GUIOnlineVideos.VideoInfo> getRssData(String fsUrl) - { - - XmlDocument doc = new XmlDocument(); - //XPathDocument doc = new XPathDocument(fsUrl); - - doc.Load(XmlReader.Create(fsUrl)); - XmlNamespaceManager expr = new XmlNamespaceManager(doc.NameTable); - expr.AddNamespace("media", "http://search.yahoo.com/mrss"); - - //Create the root XmlNode and generate an XmlNodeList from it. - XmlNode root = doc.SelectSingleNode("//rss/channel/item", expr); - XmlNodeList nodeList; - nodeList = root.SelectNodes("//rss/channel/item"); - //RssItem loRssItem = new RssItem(); - //loRssItem. - //This loops through each node found in the nodeList and adds the - //Node data to the DataTable. - XmlAttributeCollection ac; - //List<RssItem> loRssItems = new List<RssItem>(); - List<GUIOnlineVideos.VideoInfo> loRssItems = new List<GUIOnlineVideos.VideoInfo>(); - GUIOnlineVideos.VideoInfo loRssItem; - //GUIListItem loListItem; - foreach (XmlNode chileNode in nodeList) - { - loRssItem = new GUIOnlineVideos.VideoInfo(); - - XmlNode node = chileNode.SelectSingleNode("title"); - loRssItem.Title = node.InnerText; - - //node = chileNode.SelectSingleNode("link"); - //loRssItem.link = node.InnerText; - - node = chileNode.SelectSingleNode("description"); - loRssItem.Description = node.InnerText; - - node = chileNode.SelectSingleNode("media:thumbnail[@width=\"260\"]", expr); - if (node != null) - { - ac = node.Attributes; - loRssItem.ImageUrl = ac["url"].InnerText; - } - - - node = chileNode.SelectSingleNode("guid"); - if (node != null) - { - //ac = node.Attributes; - loRssItem.VideoUrl = node.InnerText; - } - - //Log.Write(loRssItem.ToString()); - //loListItem = new GUIListItem(loRssItem.title); - //loListItem.Path = loRssItem.videoUrl; - loRssItems.Add(loRssItem); - - - } - return loRssItems; - } - - */ - - } -} Modified: trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/Runner.csproj 2008-03-14 23:57:59 UTC (rev 1464) @@ -28,6 +28,10 @@ <HintPath>..\..\..\..\Mediaportal\Databases\bin\Debug\Core.dll</HintPath> <SpecificVersion>False</SpecificVersion> </Reference> + <Reference Include="Databases, Version=0.2.2.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\..\..\..\..\..\Program Files\Team MediaPortal\MediaPortal\Plugins\Windows\Databases.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Data" /> <Reference Include="System.Windows.Forms" /> Deleted: trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs =================================================================== --- trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2008-03-14 18:25:00 UTC (rev 1463) +++ trunk/plugins/OnlineVideos/Source/OnlineVideos/SiteUtilBase.cs 2008-03-14 23:57:59 UTC (rev 1464) @@ -1,349 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections; -using System.Text; -using MediaPortal.GUI.Library; -//using MediaPortal.Utils.Services; -using System.ComponentModel; -using System.Web; -using System.Net; -using System.Xml; -using System.Xml.XPath; -using System.Threading; -using OnlineVideos.Database; -using MediaPortal.Configuration; - -namespace OnlineVideos -{ - public abstract class SiteUtilBase - { - public class RssItem - { - public String title; - public String link; - public String guid; - public String pubDate; - public String description; - public String author; - public String mediaTitle; - public String mediaDescription; - public String mediaThumbnail; - public String mediaCategory; - public String exInfoImage; - public List<MediaContent> contentList; - public String enclosure; - public String enclosureDuration; - public RssItem(){ - contentList = new List<MediaContent>(); - } - } - public class MediaContent - { - public String url; - public String type; - public String medium; - public String duration; - public String width; - public String height; - - ... [truncated message content] |