From be475f7403fb3429b4107ed7c8e0697b34ab9cc4 Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Thu, 17 Mar 2016 13:23:24 -0700 Subject: [PATCH 1/7] Removed applicationinsights.config file and added Readme.md file. --- RTMPPublisher/RTMPPublisher.sln | 171 ++++---- RTMPPublisher/ReadMe.md | 12 + .../AzureRTMPPublisher.csproj | 381 +++++++++--------- 3 files changed, 289 insertions(+), 275 deletions(-) create mode 100644 RTMPPublisher/ReadMe.md diff --git a/RTMPPublisher/RTMPPublisher.sln b/RTMPPublisher/RTMPPublisher.sln index c6ba889..c08117d 100644 --- a/RTMPPublisher/RTMPPublisher.sln +++ b/RTMPPublisher/RTMPPublisher.sln @@ -1,83 +1,88 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Media.RTMP", "Microsoft.Media.RTMP\Microsoft.Media.RTMP.vcxproj", "{DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{AF527D14-E527-43D3-BF75-61E6D97069B9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureRTMPPublisher", "Samples\AzureRTMPPublisher\AzureRTMPPublisher.csproj", "{14C1E006-D593-4ED8-AC43-4C13E332BA28}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Media.RTMP.Setup", "Microsoft.Media.RTMP.Setup\Microsoft.Media.RTMP.Setup.csproj", "{47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|ARM = Debug|ARM - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|ARM = Release|ARM - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|ARM.ActiveCfg = Debug|ARM - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|ARM.Build.0 = Debug|ARM - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x64.ActiveCfg = Debug|x64 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x64.Build.0 = Debug|x64 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x86.ActiveCfg = Debug|Win32 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x86.Build.0 = Debug|Win32 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|Any CPU.ActiveCfg = Release|Win32 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|ARM.ActiveCfg = Release|ARM - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|ARM.Build.0 = Release|ARM - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x64.ActiveCfg = Release|x64 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x64.Build.0 = Release|x64 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x86.ActiveCfg = Release|Win32 - {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x86.Build.0 = Release|Win32 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|Any CPU.ActiveCfg = Debug|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.ActiveCfg = Debug|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.Build.0 = Debug|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.Deploy.0 = Debug|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.ActiveCfg = Debug|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.Build.0 = Debug|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.Deploy.0 = Debug|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.ActiveCfg = Debug|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.Build.0 = Debug|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.Deploy.0 = Debug|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|Any CPU.ActiveCfg = Release|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.ActiveCfg = Release|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.Build.0 = Release|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.Deploy.0 = Release|ARM - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.ActiveCfg = Release|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.Build.0 = Release|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.Deploy.0 = Release|x64 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.ActiveCfg = Release|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.Build.0 = Release|x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.Deploy.0 = Release|x86 - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|ARM.ActiveCfg = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|ARM.Build.0 = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x64.ActiveCfg = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x64.Build.0 = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x86.ActiveCfg = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x86.Build.0 = Debug|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|Any CPU.Build.0 = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|ARM.ActiveCfg = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|ARM.Build.0 = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x64.ActiveCfg = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x64.Build.0 = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x86.ActiveCfg = Release|Any CPU - {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {14C1E006-D593-4ED8-AC43-4C13E332BA28} = {AF527D14-E527-43D3-BF75-61E6D97069B9} - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Microsoft.Media.RTMP", "Microsoft.Media.RTMP\Microsoft.Media.RTMP.vcxproj", "{DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{AF527D14-E527-43D3-BF75-61E6D97069B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AzureRTMPPublisher", "Samples\AzureRTMPPublisher\AzureRTMPPublisher.csproj", "{14C1E006-D593-4ED8-AC43-4C13E332BA28}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Media.RTMP.Setup", "Microsoft.Media.RTMP.Setup\Microsoft.Media.RTMP.Setup.csproj", "{47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{4F1989FE-42A3-49B8-8075-8AA7D3E4C4E1}" + ProjectSection(SolutionItems) = preProject + ReadMe.md = ReadMe.md + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|ARM = Debug|ARM + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|ARM = Release|ARM + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|ARM.ActiveCfg = Debug|ARM + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|ARM.Build.0 = Debug|ARM + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x64.ActiveCfg = Debug|x64 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x64.Build.0 = Debug|x64 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x86.ActiveCfg = Debug|Win32 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Debug|x86.Build.0 = Debug|Win32 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|Any CPU.ActiveCfg = Release|Win32 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|ARM.ActiveCfg = Release|ARM + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|ARM.Build.0 = Release|ARM + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x64.ActiveCfg = Release|x64 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x64.Build.0 = Release|x64 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x86.ActiveCfg = Release|Win32 + {DDAF4D34-8057-4EB8-A7C8-BE6052E204D3}.Release|x86.Build.0 = Release|Win32 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|Any CPU.ActiveCfg = Debug|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.ActiveCfg = Debug|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.Build.0 = Debug|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|ARM.Deploy.0 = Debug|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.ActiveCfg = Debug|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.Build.0 = Debug|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x64.Deploy.0 = Debug|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.ActiveCfg = Debug|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.Build.0 = Debug|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Debug|x86.Deploy.0 = Debug|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|Any CPU.ActiveCfg = Release|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.ActiveCfg = Release|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.Build.0 = Release|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|ARM.Deploy.0 = Release|ARM + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.ActiveCfg = Release|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.Build.0 = Release|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x64.Deploy.0 = Release|x64 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.ActiveCfg = Release|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.Build.0 = Release|x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28}.Release|x86.Deploy.0 = Release|x86 + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|ARM.ActiveCfg = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|ARM.Build.0 = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x64.ActiveCfg = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x64.Build.0 = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x86.ActiveCfg = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Debug|x86.Build.0 = Debug|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|Any CPU.Build.0 = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|ARM.ActiveCfg = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|ARM.Build.0 = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x64.ActiveCfg = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x64.Build.0 = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x86.ActiveCfg = Release|Any CPU + {47AFEC4C-D2C7-480A-BECC-C81E40C48DDE}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {14C1E006-D593-4ED8-AC43-4C13E332BA28} = {AF527D14-E527-43D3-BF75-61E6D97069B9} + EndGlobalSection +EndGlobal diff --git a/RTMPPublisher/ReadMe.md b/RTMPPublisher/ReadMe.md new file mode 100644 index 0000000..8962e85 --- /dev/null +++ b/RTMPPublisher/ReadMe.md @@ -0,0 +1,12 @@ +# Azure RTMP Ingest Library + +## Prerequsites: +1. Microsoft Visual Studio 2015 Update 1 +2. Install Microsoft Universal Smooth Streaming Client SDK from Visual Studio Tools...Extensions and Updates... +3. Install Visual Studio Extensibility Tools if you want to build the SDK + +## Azure Setup: +1. Create an Azure account on WindowsAzure.com +2. Create a Media Services instance on the account +3. Once created get the name of the instance and the primary key +4. Create a new live channel \ No newline at end of file diff --git a/RTMPPublisher/Samples/AzureRTMPPublisher/AzureRTMPPublisher.csproj b/RTMPPublisher/Samples/AzureRTMPPublisher/AzureRTMPPublisher.csproj index 6438c52..8dd93cf 100644 --- a/RTMPPublisher/Samples/AzureRTMPPublisher/AzureRTMPPublisher.csproj +++ b/RTMPPublisher/Samples/AzureRTMPPublisher/AzureRTMPPublisher.csproj @@ -1,199 +1,196 @@ - - - - - Debug - x86 - {14C1E006-D593-4ED8-AC43-4C13E332BA28} - AppContainerExe - Properties - AzureRTMPPublisher - AzureRTMPPublisher - en-US - UAP - 10.0.10586.0 - 10.0.10240.0 - 14 - 512 - {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - AzureRTMPPublisher_TemporaryKey.pfx - SAK - SAK - SAK - SAK - True - Always - x86|x64|arm - - - true - bin\x86\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - x86 - false - prompt - true - - - bin\x86\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - x86 - false - prompt - true - true - - - true - bin\ARM\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - ARM - false - prompt - true - - - bin\ARM\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - ARM - false - prompt - true - true - - - true - bin\x64\Debug\ - DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP - ;2008 - full - x64 - false - prompt - true - - - bin\x64\Release\ - TRACE;NETFX_CORE;WINDOWS_UWP - true - ;2008 - pdbonly - x64 - false - prompt - true - true - - - - - PreserveNewest - - - - - - - App.xaml - - - - - - - - - - - - - - Designer - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - MSBuild:Compile - Designer - - - - - Microsoft RTMP Publish Library for Windows - - - Microsoft Player Framework Adaptive Streaming Plugin - - - Microsoft Player Framework - - - Visual C++ 2015 Runtime for Universal Windows Platform Apps - - - Microsoft Universal Smooth Streaming Client SDK - - - - 14.0 - - + + + + + Debug + x86 + {14C1E006-D593-4ED8-AC43-4C13E332BA28} + AppContainerExe + Properties + AzureRTMPPublisher + AzureRTMPPublisher + en-US + UAP + 10.0.10586.0 + 10.0.10240.0 + 14 + 512 + {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + AzureRTMPPublisher_TemporaryKey.pfx + SAK + SAK + SAK + SAK + True + Always + x86|x64|arm + + + true + bin\x86\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x86 + false + prompt + true + + + bin\x86\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x86 + false + prompt + true + true + + + true + bin\ARM\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + ARM + false + prompt + true + + + bin\ARM\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + ARM + false + prompt + true + true + + + true + bin\x64\Debug\ + DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP + ;2008 + full + x64 + false + prompt + true + + + bin\x64\Release\ + TRACE;NETFX_CORE;WINDOWS_UWP + true + ;2008 + pdbonly + x64 + false + prompt + true + true + + + + + + + + + App.xaml + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + MSBuild:Compile + Designer + + + + + Microsoft RTMP Publish Library for Windows + + + Microsoft Player Framework Adaptive Streaming Plugin + + + Microsoft Player Framework + + + Visual C++ 2015 Runtime for Universal Windows Platform Apps + + + Microsoft Universal Smooth Streaming Client SDK + + + + 14.0 + + + --> \ No newline at end of file From 10ad9be56a31245d9fe5af1ab8d7cc711b8b6ceb Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Thu, 17 Mar 2016 14:27:22 -0700 Subject: [PATCH 2/7] Added initial ReadMe.md --- RTMPPublisher/ReadMe.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/RTMPPublisher/ReadMe.md b/RTMPPublisher/ReadMe.md index 8962e85..7e7abd9 100644 --- a/RTMPPublisher/ReadMe.md +++ b/RTMPPublisher/ReadMe.md @@ -1,4 +1,5 @@ # Azure RTMP Ingest Library +Last updated 3/17/2016 ## Prerequsites: 1. Microsoft Visual Studio 2015 Update 1 @@ -9,4 +10,9 @@ 1. Create an Azure account on WindowsAzure.com 2. Create a Media Services instance on the account 3. Once created get the name of the instance and the primary key -4. Create a new live channel \ No newline at end of file +4. Create a new live channel with + 1. "none" encoding, + 2. RTMP ingest protocol + 3. No IP restrictions + 4. Keep "Start the channel now" and "Add one streaming unit" checked +5. Create a program in the channel \ No newline at end of file From 7073f57197457eeabc0ae707896062e863a26514 Mon Sep 17 00:00:00 2001 From: mscherotter Date: Thu, 17 Mar 2016 14:28:31 -0700 Subject: [PATCH 3/7] Create README.md --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..63b1e39 --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# Azure RTMP Ingest Library +Last updated 3/17/2016 + +## Prerequsites: +1. Microsoft Visual Studio 2015 Update 1 +2. Install Microsoft Universal Smooth Streaming Client SDK from Visual Studio Tools...Extensions and Updates... +3. Install Visual Studio Extensibility Tools if you want to build the SDK + +## Azure Setup: +1. Create an Azure account on WindowsAzure.com +2. Create a Media Services instance on the account +3. Once created get the name of the instance and the primary key +4. Create a new live channel with + 1. "none" encoding, + 2. RTMP ingest protocol + 3. No IP restrictions + 4. Keep "Start the channel now" and "Add one streaming unit" checked +5. Create a program in the channel From ef93b1822e030a5c0aaa48c67bde82f4ea8db30b Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Thu, 17 Mar 2016 15:54:32 -0700 Subject: [PATCH 4/7] Added error handling debug message --- RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs index aeb11f3..b8eef38 100644 --- a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs +++ b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs @@ -193,8 +193,8 @@ private async void btnPublish_Checked(object sender, RoutedEventArgs e) }), null, 0, 500); } catch (Exception Ex) - { - + { + System.Diagnostics.Debug.WriteLine("Error starting recording: {0}", Ex); } } From f5d4ffef2c2801550a9136f57ffb58561116209b Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Fri, 18 Mar 2016 09:51:52 -0700 Subject: [PATCH 5/7] Updated README.md --- RTMPPublisher/ReadMe.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RTMPPublisher/ReadMe.md b/RTMPPublisher/ReadMe.md index 7e7abd9..1b73523 100644 --- a/RTMPPublisher/ReadMe.md +++ b/RTMPPublisher/ReadMe.md @@ -1,10 +1,11 @@ # Azure RTMP Ingest Library -Last updated 3/17/2016 +Last updated 3/18/2016 ## Prerequsites: 1. Microsoft Visual Studio 2015 Update 1 -2. Install Microsoft Universal Smooth Streaming Client SDK from Visual Studio Tools...Extensions and Updates... -3. Install Visual Studio Extensibility Tools if you want to build the SDK +2. Install Microsoft Universal Smooth Streaming Client SDK from Visual Studio... Tools...Extensions and Updates... +3. Install [Microsoft Media Platform Player Framework](http://playerframework.codeplex.com) +4. Install Visual Studio Extensibility Tools if you want to build the SDK ## Azure Setup: 1. Create an Azure account on WindowsAzure.com From 357e5b739de4dc09859ae7dd196dacbb0b7e1208 Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Fri, 18 Mar 2016 09:59:53 -0700 Subject: [PATCH 6/7] Added background to publish view channel/clock so that it could be seen easier. --- RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml index 2d5709b..e50306a 100644 --- a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml +++ b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml @@ -166,7 +166,7 @@ OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Style="{StaticResource AppBarToggleButtonStyle}" IsEnabled="False" Grid.RowSpan="2" Grid.Row="0" Grid.Column="1" Width="Auto" MinWidth="48" MinHeight="48" Grid.ColumnSpan="1"/> - + From 49878e10e570ede57904a08de07c222d58306f5a Mon Sep 17 00:00:00 2001 From: "Michael S. Scherotter" Date: Fri, 18 Mar 2016 10:02:11 -0700 Subject: [PATCH 7/7] Updated background of sample publish view page for channel & clock to make them easier to see. --- .../AzureRTMPPublisher/PublishView.xaml.cs | 646 +++++++++--------- 1 file changed, 323 insertions(+), 323 deletions(-) diff --git a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs index b8eef38..8dafb9d 100644 --- a/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs +++ b/RTMPPublisher/Samples/AzureRTMPPublisher/PublishView.xaml.cs @@ -1,324 +1,324 @@ -/**************************************************************************************************************************** - -RTMP Live Publishing Library - -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation -files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, -modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF -OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - -*****************************************************************************************************************************/ - -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Windows.Media.Capture; -using Windows.Media.Streaming.Adaptive; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Navigation; -using Microsoft.Media.RTMP; - -// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 - -namespace RTMPPublisher -{ - public sealed partial class PublishView : Page - { - - - RTMPPublishSession _publishsession = null; - Channel _targetChannel = null; - SessionManager _deviceManager = null; - TimeSpan sessionduration = TimeSpan.FromSeconds(0); - System.Threading.Timer _clockTimer = null; - LowLagMediaRecording _lowlagCapture = null; - - public void SetTargetChannel(Channel c) - { - - _targetChannel = c; - tbChannel.Text = c.Name + " - " + c.Description; - - } - public async Task ApplyTargetChannels() - { - if (_deviceManager == null) - return; - - var epuri = _targetChannel.Input.Endpoints.Where(iep => iep.Protocol == "RTMP").First().Url; - var endpointhistory = _deviceManager.AddIngestURLToHistory(epuri, "AZURE"); - foreach (var prof in _deviceManager.PublishProfiles) - { - prof.EndpointUri = epuri; - if (endpointhistory != null && _deviceManager.UseContinuousTimestamps) - { - prof.AudioTimestampBase = endpointhistory.LastAudioTS + 40000000; //add a 4 second offset per AMS PG suggestion - prof.VideoTimestampBase = endpointhistory.LastVideoTS + 40000000; - } - else - { - prof.AudioTimestampBase = -1; - prof.VideoTimestampBase = -1; - } - } - - _deviceManager.StreamURL = _targetChannel.Preview.Endpoints.Where(pep => pep.Protocol == "FragmentedMP4").First().Url; - _deviceManager.AddStreamURLToHistory(_deviceManager.StreamURL, "SMOOTH"); - - _deviceManager.StreamType = "SMOOTH"; - - - } - - public PublishView() - { - this.InitializeComponent(); - - Window.Current.Activated += Current_Activated; - } - - protected async override void OnNavigatedTo(NavigationEventArgs e) - { - _deviceManager = (Application.Current as App).DeviceManager; - - await _deviceManager.InitializeAsync(ceSourcePreview); - await StartPreviewAsync(); - - if (e.Parameter != null && e.Parameter is Channel) - { - this.SetTargetChannel(e.Parameter as Channel); - } - } - - protected async override void OnNavigatingFrom(NavigatingCancelEventArgs e) - { - _targetChannel = null; - btnPublish_Unchecked(null, null); - } - private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e) - { - if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated) - DismissSettings(); - } - - private void btnSettings_Click(object sender, RoutedEventArgs e) - { - VisualStateManager.GoToState(this, "ShowRightPanelSettingsLauncher", true); - } - - private void SettingsLauncher_OnSettingsSelectionChanged(int SelectionIndex) - { - switch (SelectionIndex) - { - case 0: - VisualStateManager.GoToState(this, "ShowRightPanelDeviceSettings", true); - break; - case 1: - VisualStateManager.GoToState(this, "ShowRightPanelOutputSettings", true); - break; - //case 2: - // VisualStateManager.GoToState(this, "ShowRightPanelStreamSettings", true); - // break; - default: - break; - } - } - - private void OnSettingsDismissed(object sender, EventArgs e) - { - if (sender == ccSettingsLauncher) - DismissSettings(); - else - { - VisualStateManager.GoToState(this, "ShowRightPanelSettingsLauncher", true); - } - } - - private async void btnPublish_Checked(object sender, RoutedEventArgs e) - { - try - { - - await ApplyTargetChannels(); - //RTMP Publish specific Code - - var inputprof = _deviceManager.GetInputProfile(); - - _publishsession = new RTMPPublishSession(_deviceManager.PublishProfiles); - - //handle events (if needed) - _publishsession.PublishFailed += OnPublishFailed; - _publishsession.SessionClosed += OnSessionClosed; - //get the sink - var sink = await _publishsession.GetCaptureSinkAsync(); - - if (_deviceManager.EnableLowLatency) - { - _lowlagCapture = await _deviceManager.CurrentCapture.PrepareLowLagRecordToCustomSinkAsync(inputprof, sink); - await _lowlagCapture.StartAsync(); - } - else - await _deviceManager.CurrentCapture.StartRecordToCustomSinkAsync(inputprof, sink); - - - - _deviceManager.IsPublishing = true; - sessionduration = TimeSpan.FromSeconds(0); - _clockTimer = new Timer(new TimerCallback((o) => - { - this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => - { - sessionduration = sessionduration.Add(TimeSpan.FromMilliseconds(500)); - tbClock.Text = sessionduration.ToString(@"hh\:mm\:ss\:fff"); - if (sessionduration.Seconds >= 30) //need at least 30 seconds of content published before streaming - btnStream.IsEnabled = true; - }); - }), null, 0, 500); - } - catch (Exception Ex) +/**************************************************************************************************************************** + +RTMP Live Publishing Library + +Copyright (c) Microsoft Corporation + +All rights reserved. + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation +files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, +modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +*****************************************************************************************************************************/ + +using System; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Windows.Media.Capture; +using Windows.Media.Streaming.Adaptive; +using Windows.UI.Xaml; +using Windows.UI.Xaml.Controls; +using Windows.UI.Xaml.Input; +using Windows.UI.Xaml.Navigation; +using Microsoft.Media.RTMP; + +// The User Control item template is documented at http://go.microsoft.com/fwlink/?LinkId=234236 + +namespace RTMPPublisher +{ + public sealed partial class PublishView : Page + { + + + RTMPPublishSession _publishsession = null; + Channel _targetChannel = null; + SessionManager _deviceManager = null; + TimeSpan sessionduration = TimeSpan.FromSeconds(0); + System.Threading.Timer _clockTimer = null; + LowLagMediaRecording _lowlagCapture = null; + + public void SetTargetChannel(Channel c) + { + + _targetChannel = c; + tbChannel.Text = c.Name + " - " + c.Description; + + } + public async Task ApplyTargetChannels() + { + if (_deviceManager == null) + return; + + var epuri = _targetChannel.Input.Endpoints.Where(iep => iep.Protocol == "RTMP").First().Url; + var endpointhistory = _deviceManager.AddIngestURLToHistory(epuri, "AZURE"); + foreach (var prof in _deviceManager.PublishProfiles) { - System.Diagnostics.Debug.WriteLine("Error starting recording: {0}", Ex); - } - } - - private async void btnPublish_Unchecked(object sender, RoutedEventArgs e) - { - try - { - if (_clockTimer != null) - _clockTimer.Change(Timeout.Infinite, Timeout.Infinite); - _clockTimer = null; - tbClock.Text = ""; - btnStream.IsEnabled = false; - if (_deviceManager.IsPublishing) - { - if (_deviceManager.EnableLowLatency && _lowlagCapture != null) - await _lowlagCapture.FinishAsync(); - else - await _deviceManager.CurrentCapture.StopRecordAsync(); - } - - await _deviceManager.SaveHistoryAsync(); - } - catch (Exception Ex) - { - - } - - _deviceManager.IsPublishing = false; - } - - private async void btnStream_Checked(object sender, RoutedEventArgs e) - { - try - { - if (_deviceManager.StreamType == "DASH" || _deviceManager.StreamType == "HLS") - { - var result = await AdaptiveMediaSource.CreateFromUriAsync(new Uri(_deviceManager.StreamURL)); - if (result.Status == AdaptiveMediaSourceCreationStatus.Success) - { - mpStreamPreview.SetMediaStreamSource(result.MediaSource); - } - } - else - { - mpStreamPreview.Source = new Uri(_deviceManager.StreamURL); - } - - mpStreamPreview.Visibility = Visibility.Visible; - - - } - catch - { - - } - } - - private void btnStream_Unchecked(object sender, RoutedEventArgs e) - { - mpStreamPreview.Stop(); - mpStreamPreview.Source = null; - mpStreamPreview.Visibility = Visibility.Collapsed; - } - - private void SettingsDismiss_PointerPressed(object sender, PointerRoutedEventArgs e) - { - DismissSettings(); - - } - - private void DismissSettings() - { - - ccOutputSettings.OnClose(); - VisualStateManager.GoToState(this, "HideSettings", true); - } - - - public async Task StartPreviewAsync() - { - if (_deviceManager.IsPreviewing == false) - { - await _deviceManager.RestartCapturePreviewAsync(null, null); - } - - if (ccDeviceSettings.Manager == null) - ccDeviceSettings.Manager = _deviceManager; - if (ccOutputSettings.Manager == null) - ccOutputSettings.Manager = _deviceManager; - } - - - private async void OnSessionClosed(RTMPPublishSession sender, SessionClosedEventArgs args) - { - - await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(() => - { - try - { - - if (_deviceManager.History != null) - _deviceManager.AddIngestURLToHistory(_deviceManager.PublishProfiles[0].EndpointUri, "AZURE", args.LastVideoTimestamp, args.LastAudioTimestamp); - } - catch - { - - } - btnStream.IsChecked = false; - - })); - } - - private async void OnPublishFailed(RTMPPublishSession sender, FailureEventArgs args) - { - return; - } - - - private void btnBack_Click(object sender, RoutedEventArgs e) - { - btnPublish_Unchecked(null, null); - this.Frame.GoBack(); - } - - - } -} + prof.EndpointUri = epuri; + if (endpointhistory != null && _deviceManager.UseContinuousTimestamps) + { + prof.AudioTimestampBase = endpointhistory.LastAudioTS + 40000000; //add a 4 second offset per AMS PG suggestion + prof.VideoTimestampBase = endpointhistory.LastVideoTS + 40000000; + } + else + { + prof.AudioTimestampBase = -1; + prof.VideoTimestampBase = -1; + } + } + + _deviceManager.StreamURL = _targetChannel.Preview.Endpoints.Where(pep => pep.Protocol == "FragmentedMP4").First().Url; + _deviceManager.AddStreamURLToHistory(_deviceManager.StreamURL, "SMOOTH"); + + _deviceManager.StreamType = "SMOOTH"; + + + } + + public PublishView() + { + this.InitializeComponent(); + + Window.Current.Activated += Current_Activated; + } + + protected async override void OnNavigatedTo(NavigationEventArgs e) + { + _deviceManager = (Application.Current as App).DeviceManager; + + await _deviceManager.InitializeAsync(ceSourcePreview); + await StartPreviewAsync(); + + if (e.Parameter != null && e.Parameter is Channel) + { + this.SetTargetChannel(e.Parameter as Channel); + } + } + + protected async override void OnNavigatingFrom(NavigatingCancelEventArgs e) + { + _targetChannel = null; + btnPublish_Unchecked(null, null); + } + private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e) + { + if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated) + DismissSettings(); + } + + private void btnSettings_Click(object sender, RoutedEventArgs e) + { + VisualStateManager.GoToState(this, "ShowRightPanelSettingsLauncher", true); + } + + private void SettingsLauncher_OnSettingsSelectionChanged(int SelectionIndex) + { + switch (SelectionIndex) + { + case 0: + VisualStateManager.GoToState(this, "ShowRightPanelDeviceSettings", true); + break; + case 1: + VisualStateManager.GoToState(this, "ShowRightPanelOutputSettings", true); + break; + //case 2: + // VisualStateManager.GoToState(this, "ShowRightPanelStreamSettings", true); + // break; + default: + break; + } + } + + private void OnSettingsDismissed(object sender, EventArgs e) + { + if (sender == ccSettingsLauncher) + DismissSettings(); + else + { + VisualStateManager.GoToState(this, "ShowRightPanelSettingsLauncher", true); + } + } + + private async void btnPublish_Checked(object sender, RoutedEventArgs e) + { + try + { + + await ApplyTargetChannels(); + //RTMP Publish specific Code + + var inputprof = _deviceManager.GetInputProfile(); + + _publishsession = new RTMPPublishSession(_deviceManager.PublishProfiles); + + //handle events (if needed) + _publishsession.PublishFailed += OnPublishFailed; + _publishsession.SessionClosed += OnSessionClosed; + //get the sink + var sink = await _publishsession.GetCaptureSinkAsync(); + + if (_deviceManager.EnableLowLatency) + { + _lowlagCapture = await _deviceManager.CurrentCapture.PrepareLowLagRecordToCustomSinkAsync(inputprof, sink); + await _lowlagCapture.StartAsync(); + } + else + await _deviceManager.CurrentCapture.StartRecordToCustomSinkAsync(inputprof, sink); + + + + _deviceManager.IsPublishing = true; + sessionduration = TimeSpan.FromSeconds(0); + _clockTimer = new Timer(new TimerCallback((o) => + { + this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => + { + sessionduration = sessionduration.Add(TimeSpan.FromMilliseconds(500)); + tbClock.Text = sessionduration.ToString(@"hh\:mm\:ss\:fff"); + if (sessionduration.Seconds >= 30) //need at least 30 seconds of content published before streaming + btnStream.IsEnabled = true; + }); + }), null, 0, 500); + } + catch (Exception Ex) + { + System.Diagnostics.Debug.WriteLine("Error starting recording: {0}", Ex); + } + } + + private async void btnPublish_Unchecked(object sender, RoutedEventArgs e) + { + try + { + if (_clockTimer != null) + _clockTimer.Change(Timeout.Infinite, Timeout.Infinite); + _clockTimer = null; + tbClock.Text = ""; + btnStream.IsEnabled = false; + if (_deviceManager.IsPublishing) + { + if (_deviceManager.EnableLowLatency && _lowlagCapture != null) + await _lowlagCapture.FinishAsync(); + else + await _deviceManager.CurrentCapture.StopRecordAsync(); + } + + await _deviceManager.SaveHistoryAsync(); + } + catch (Exception Ex) + { + + } + + _deviceManager.IsPublishing = false; + } + + private async void btnStream_Checked(object sender, RoutedEventArgs e) + { + try + { + if (_deviceManager.StreamType == "DASH" || _deviceManager.StreamType == "HLS") + { + var result = await AdaptiveMediaSource.CreateFromUriAsync(new Uri(_deviceManager.StreamURL)); + if (result.Status == AdaptiveMediaSourceCreationStatus.Success) + { + mpStreamPreview.SetMediaStreamSource(result.MediaSource); + } + } + else + { + mpStreamPreview.Source = new Uri(_deviceManager.StreamURL); + } + + mpStreamPreview.Visibility = Visibility.Visible; + + + } + catch + { + + } + } + + private void btnStream_Unchecked(object sender, RoutedEventArgs e) + { + mpStreamPreview.Stop(); + mpStreamPreview.Source = null; + mpStreamPreview.Visibility = Visibility.Collapsed; + } + + private void SettingsDismiss_PointerPressed(object sender, PointerRoutedEventArgs e) + { + DismissSettings(); + + } + + private void DismissSettings() + { + + ccOutputSettings.OnClose(); + VisualStateManager.GoToState(this, "HideSettings", true); + } + + + public async Task StartPreviewAsync() + { + if (_deviceManager.IsPreviewing == false) + { + await _deviceManager.RestartCapturePreviewAsync(null, null); + } + + if (ccDeviceSettings.Manager == null) + ccDeviceSettings.Manager = _deviceManager; + if (ccOutputSettings.Manager == null) + ccOutputSettings.Manager = _deviceManager; + } + + + private async void OnSessionClosed(RTMPPublishSession sender, SessionClosedEventArgs args) + { + + await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, new Windows.UI.Core.DispatchedHandler(() => + { + try + { + + if (_deviceManager.History != null) + _deviceManager.AddIngestURLToHistory(_deviceManager.PublishProfiles[0].EndpointUri, "AZURE", args.LastVideoTimestamp, args.LastAudioTimestamp); + } + catch + { + + } + btnStream.IsChecked = false; + + })); + } + + private async void OnPublishFailed(RTMPPublishSession sender, FailureEventArgs args) + { + return; + } + + + private void btnBack_Click(object sender, RoutedEventArgs e) + { + btnPublish_Unchecked(null, null); + this.Frame.GoBack(); + } + + + } +}