This works on html 5 supported browsers.
A Pen by Chinh Vo Wili on CodePen.
| /** | |
| * Methods required by a custom player for `react-player` | |
| */ | |
| export interface Player { | |
| load(url?: string): void; | |
| seekTo(amount: number, type?: 'seconds' | 'fraction'): void; | |
| getCurrentTime(): number; | |
| getDuration(): number; | |
| getSecondsLoaded(): number | null; | |
| stop?(): void; |
| import React, { Component } from "react"; | |
| import ReactPlayer, { ReactPlayerProps } from "react-player"; | |
| import { getSDK } from "react-player/lib/utils"; | |
| import { | |
| Player, | |
| IkWidget, | |
| KalturaNotificationName, | |
| KalturaPlayerElement, | |
| KalturaPlayerEvents, |
| app.MapGet("/background", ( | |
| PeriodicHostedService service) => | |
| { | |
| return new PeriodicHostedServiceState(service.IsEnabled); | |
| }); |
| class PeriodicHostedService : BackgroundService | |
| { | |
| private readonly TimeSpan _period = TimeSpan.FromSeconds(5); | |
| private readonly ILogger<PeriodicHostedService> _logger; | |
| private readonly IServiceScopeFactory _factory; | |
| private int _executionCount = 0; | |
| public bool IsEnabled { get; set; } | |
| public PeriodicHostedService( | |
| ILogger<PeriodicHostedService> logger, |
| private int _executionCount = 0; | |
| public bool IsEnabled { get; set; } | |
| protected override async Task ExecuteAsync(CancellationToken stoppingToken) | |
| { | |
| using PeriodicTimer timer = new PeriodicTimer(_period); | |
| while ( | |
| !stoppingToken.IsCancellationRequested && | |
| await timer.WaitForNextTickAsync(stoppingToken)) | |
| { |
This works on html 5 supported browsers.
A Pen by Chinh Vo Wili on CodePen.
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Net.Http; | |
| using System.Threading.Tasks; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| namespace TestAPIGithub.Controllers | |
| { |
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| services.AddControllers(); | |
| //configure httpclient service | |
| services.AddHttpClient("GithubAPI", client=> | |
| { | |
| //customize as per your need | |
| client.BaseAddress = new Uri("http://api.github.com/"); | |
| client.DefaultRequestHeaders.Add("Accept", "application/vnd.github.v3+json"); |
| const fs = require("fs"); | |
| const path = require("path"); | |
| function fixFile(filepath) { | |
| const contents = fs.readFileSync(filepath, "utf-8"); | |
| const matcher = /([0-9]+(?:\.[0-9]+)?)rem/igm; | |
| const result = contents.replaceAll(matcher, (substr, size) => { | |
| const rem = Number(size); |
| #include <winsock2.h> | |
| #include <iostream> | |
| struct CLIENT_INFO { | |
| SOCKET hClientSocket; | |
| struct sockaddr_in clientAddr; | |
| }; | |
| char szServerIPAddr[] = "192.168.1.4"; // Put here the IP address of the server | |
| int nServerPort = 5050; // The server port that will be used by |