Coder Social home page Coder Social logo

lakshmansamanth / angular5-videogular-videostreaming-webapi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anthonygiretti/angular5-videogular-videostreaming-webapi

0.0 1.0 0.0 57 KB

Example of a streaming platform built with Angular5, Videogular and ASP.NET Core Web API

C# 29.96% TypeScript 38.34% JavaScript 12.11% HTML 17.48% CSS 2.11%

angular5-videogular-videostreaming-webapi's Introduction

Angular5-videogular-videostreaming-webapi

Example of a streaming platform built with Angular5, Videogular and a streaming ASP.NET Core Web API

Compatibility : Chrome, Firefox, Microsoft Edge

Streaming gallery

Set up Angular 5 with Videogular:

Create an Angular application with the Angular CLI:

ng new myStreamingGallery --style=scss

Now you can install the videogular2 library and core-js typings:

npm install videogular2 --save npm install @types/core-js --save-dev

If you want to, you can use the official Videogular font to set icons on your buttons and controls. To do that you need to add a CSS on you .angular-cli.json file available on the root of your project.

{ ... "apps": [ { ... "styles": [ "../node_modules/videogular2/fonts/videogular.css", "styles.scss" ], ... } ], ... }

To start using Videogular in your project you have to add the Videogular module to your application module.

Open src/app/app.module.ts and remove the FormsModule and the HttpModule, we will not need that for this demo. This is how your app.module.ts file should like:

import {NgModule} from "@angular/core"; import {BrowserModule} from "@angular/platform-browser"; import {VgCoreModule} from "videogular2/core"; import {VgControlsModule} from "videogular2/controls"; import {VgOverlayPlayModule} from "videogular2/overlay-play"; import {VgBufferingModule} from "videogular2/buffering"; import {AppComponent} from "./app.component"; @NgModule({ declarations: [AppComponent], imports: [ BrowserModule, VgCoreModule, VgControlsModule, VgOverlayPlayModule, VgBufferingModule ], providers: [], bootstrap: [AppComponent] }) export class AppModule { }

For more details about Videogular you can visit the website: (Videogular)[http://videogular.github.io/videogular2/docs/]

Set up ASP.NET Core Web API:

Use FilStreamResult in your controller to stream a video

[HttpGet("{name}")] public async Task<FileStreamResult> Get(string name) { var stream = await _streamingService.GetVideoByName(name); return new FileStreamResult(stream, "video/mp4"); }

Just launch the Web API and select your streamed video like this: http://localhost:{your port}/api/streaming/nature2 and http://localhost:{your port}/api/streaming/nature1

Then build your gallery! :)

angular5-videogular-videostreaming-webapi's People

Contributors

anthonygiretti avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.