Skip to content

Commit

Permalink
Merge pull request #6 from Mercurial/master
Browse files Browse the repository at this point in the history
Pull updates from Base repository
  • Loading branch information
nstr-tan authored Jul 31, 2020
2 parents 0f316d3 + 9dfe45e commit c7f9c18
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 23 deletions.
9 changes: 9 additions & 0 deletions BlazorMedia.Demo/BlazorMedia.Demo.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>BlazorMedia.Demo</ActiveDebugProfile>
</PropertyGroup>
</Project>
31 changes: 31 additions & 0 deletions BlazorMedia.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30225.117
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorMedia", "BlazorMedia\BlazorMedia.csproj", "{2EF5949A-A495-4896-BC32-91FA57F92DD4}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BlazorMedia.Demo", "BlazorMedia.Demo\BlazorMedia.Demo.csproj", "{531F3F53-E031-477F-BAE5-0FCA1E8AEAF0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2EF5949A-A495-4896-BC32-91FA57F92DD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2EF5949A-A495-4896-BC32-91FA57F92DD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EF5949A-A495-4896-BC32-91FA57F92DD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EF5949A-A495-4896-BC32-91FA57F92DD4}.Release|Any CPU.Build.0 = Release|Any CPU
{531F3F53-E031-477F-BAE5-0FCA1E8AEAF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{531F3F53-E031-477F-BAE5-0FCA1E8AEAF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{531F3F53-E031-477F-BAE5-0FCA1E8AEAF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{531F3F53-E031-477F-BAE5-0FCA1E8AEAF0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3FB8B58C-FDE4-47AB-AD98-28DAD32195D3}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion BlazorMedia/BlazorMedia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<LangVersion>8.0</LangVersion>
<RazorLangVersion>3.0</RazorLangVersion>
<AddRazorSupportForMvc>true</AddRazorSupportForMvc>
<Version>0.3.0.7</Version>
<Version>0.3.0.9</Version>
<Authors>Rory Clark Manuelle Alesna, Nestor Angelo Tan</Authors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
Expand Down
4 changes: 2 additions & 2 deletions BlazorMedia/tsconfig.tsbuildinfo
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"affectsGlobalScope": true
},
"./wwwroot/blazormedia.ts": {
"version": "cf97729ababdae24740a06108ee38259e73e0a661fa50325f3d16da81770609c",
"signature": "b547b9d15246f3bd076b2a8ad8bd229790bced51876304a9703248924bd33aff",
"version": "d667c85e81a2d6dc88bad6dbdd27f6af5377095cde79d6b1098f1e2f9c7fb712",
"signature": "b747948aaca5cafe9c2ae5fa00d7494c572247acfbe2ac066300c7cc9123bef9",
"affectsGlobalScope": true
},
"./node_modules/@types/dom-mediacapture-record/index.d.ts": {
Expand Down
23 changes: 12 additions & 11 deletions BlazorMedia/wwwroot/BlazorMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,17 @@ var BlazorMedia;
BlazorMediaInterop.AddBlazorFPSListener = function (videoElement, componentRef) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
videoElement.lastFPS = 0;
// FPS Counter
videoElement.fpsIntervalId = setInterval(function () {
if (videoElement) {
var frameRate = videoElement.getVideoPlaybackQuality().totalVideoFrames - videoElement.lastFPS;
videoElement.lastFPS = videoElement.getVideoPlaybackQuality().totalVideoFrames;
componentRef.invokeMethodAsync("ReceiveFPS", frameRate);
}
}, 1000);
if (videoElement) {
videoElement.lastFPS = 0;
// FPS Counter
videoElement.fpsIntervalId = setInterval(function () {
if (videoElement) {
var frameRate = videoElement.getVideoPlaybackQuality().totalVideoFrames - videoElement.lastFPS;
videoElement.lastFPS = videoElement.getVideoPlaybackQuality().totalVideoFrames;
componentRef.invokeMethodAsync("ReceiveFPS", frameRate);
}
}, 1000);
}
return [2 /*return*/];
});
});
Expand Down Expand Up @@ -238,11 +240,10 @@ var BlazorMedia;
};
BlazorMediaInterop.HandleDeviceDisconnection = function (videoElement, componentRef) {
return __awaiter(this, void 0, void 0, function () {
var tracks, devices, videoIsStillConnected, audioIsStillConnected, y, device, mediaError;
var devices, videoIsStillConnected, audioIsStillConnected, y, device, mediaError;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
tracks = videoElement.mediaStream.getTracks();
if (!(videoElement.mediaStream && videoElement.mediaRecorder && videoElement.mediaRecorder.state != 'inactive')) return [3 /*break*/, 2];
return [4 /*yield*/, navigator.mediaDevices.enumerateDevices()];
case 1:
Expand Down
20 changes: 11 additions & 9 deletions BlazorMedia/wwwroot/BlazorMedia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,15 +114,17 @@ namespace BlazorMedia {
}

static async AddBlazorFPSListener(videoElement: BlazorMediaVideoElement, componentRef: any) {
videoElement.lastFPS = 0;
// FPS Counter
videoElement.fpsIntervalId = setInterval(() => {
if (videoElement) {
let frameRate = videoElement.getVideoPlaybackQuality().totalVideoFrames - videoElement.lastFPS;
videoElement.lastFPS = videoElement.getVideoPlaybackQuality().totalVideoFrames;
componentRef.invokeMethodAsync("ReceiveFPS", frameRate);
}
}, 1000);
if (videoElement) {
videoElement.lastFPS = 0;
// FPS Counter
videoElement.fpsIntervalId = setInterval(() => {
if (videoElement) {
let frameRate = videoElement.getVideoPlaybackQuality().totalVideoFrames - videoElement.lastFPS;
videoElement.lastFPS = videoElement.getVideoPlaybackQuality().totalVideoFrames;
componentRef.invokeMethodAsync("ReceiveFPS", frameRate);
}
}, 1000);
}
}

static async RemoveBlazorFPSListener(videoElement: BlazorMediaVideoElement) {
Expand Down

0 comments on commit c7f9c18

Please sign in to comment.