10 | 11 |
12 | 15 | 16 | 17 | {{format}} 18 | 19 | 20 | 21 | 22 |
23 | 24 | SCTE35 TAG 25 | 27 | 28 | A valid SCTE35 is required 29 | 30 | 31 |
32 | 33 | 34 | 35 | 36 | 37 |
38 | Parsed SCTE-35 39 |
40 | 41 | 42 |
{{rawObject}}
43 | 44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 |
53 | 54 | 55 | 56 | 57 | 58 | 60 | 63 | 64 | 65 |
66 | -------------------------------------------------------------------------------- /ui/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { AppComponent } from './app.component'; 2 | 3 | describe('AppComponent', () => { 4 | it('should create the app', () => { 5 | const app = new AppComponent(); 6 | expect(app).toBeTruthy(); 7 | }); 8 | it(`should have as title 'SCTE35-JS PARSER DEMO (v0.6.0)'`, () => { 9 | const app = new AppComponent(); 10 | expect(app.title).toEqual('SCTE35-JS PARSER DEMO (v0.6.0)'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /ui/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from '@angular/core'; 2 | import { FormControl, Validators } from '@angular/forms'; 3 | import { SCTE35 } from 'scte35'; 4 | 5 | @Component({ 6 | selector: 'app-root', 7 | templateUrl: './app.component.html', 8 | styleUrls: ['./app.component.css'] 9 | }) 10 | 11 | export class AppComponent { 12 | scte35: SCTE35 = new SCTE35(); 13 | title = 'SCTE35-JS PARSER DEMO (v0.6.0)'; 14 | scte35format = 'Base64'; 15 | formats: string[] = ['Base64', 'Hexadecimal']; 16 | scte35FormControl = new FormControl('', [ 17 | Validators.required 18 | ]); 19 | parsedObject: unknown; 20 | rawObject: string = ''; 21 | displayObject: unknown; 22 | raw = false; 23 | 24 | parse(): void { 25 | switch (this.scte35format) { 26 | case 'Base64': 27 | this.parsedObject = this.scte35.parseFromB64(this.scte35FormControl.value ?? ""); 28 | break; 29 | case 'Hexadecimal': 30 | this.parsedObject = this.scte35.parseFromHex(this.scte35FormControl.value ?? ""); 31 | break; 32 | } 33 | this.displayObject = this.parsedObject; 34 | this.rawObject = JSON.stringify(this.parsedObject); 35 | } 36 | 37 | viewRaw(): void { 38 | this.displayObject = this.rawObject; 39 | this.raw = true; 40 | 41 | } 42 | 43 | viewPretty(): void { 44 | this.displayObject = this.parsedObject; 45 | this.raw = false; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /ui/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { BrowserModule } from '@angular/platform-browser'; 2 | import { NgModule } from '@angular/core'; 3 | import { AppComponent } from './app.component'; 4 | import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; 5 | import { MatRadioModule } from '@angular/material/radio'; 6 | import { FormsModule, ReactiveFormsModule } from '@angular/forms'; 7 | import { MatInputModule } from '@angular/material/input'; 8 | import { MatButtonModule } from '@angular/material/button'; 9 | import { NgxJsonViewerModule } from 'ngx-json-viewer'; 10 | import { MatCardModule } from '@angular/material/card'; 11 | 12 | @NgModule({ 13 | declarations: [ 14 | AppComponent 15 | ], 16 | imports: [ 17 | BrowserModule, 18 | BrowserAnimationsModule, 19 | MatRadioModule, 20 | FormsModule, 21 | MatInputModule, 22 | ReactiveFormsModule, 23 | MatButtonModule, 24 | NgxJsonViewerModule, 25 | MatCardModule 26 | ], 27 | providers: [], 28 | bootstrap: [AppComponent] 29 | }) 30 | export class AppModule { } 31 | -------------------------------------------------------------------------------- /ui/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Comcast/scte35-js/2248183d7da11a9bcb40c69f7b9ae9d9f6d2f5dc/ui/src/assets/.gitkeep -------------------------------------------------------------------------------- /ui/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Comcast/scte35-js/2248183d7da11a9bcb40c69f7b9ae9d9f6d2f5dc/ui/src/favicon.ico -------------------------------------------------------------------------------- /ui/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Scte35JsDemo 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ui/src/main.ts: -------------------------------------------------------------------------------- 1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; 2 | 3 | import { AppModule } from './app/app.module'; 4 | 5 | 6 | platformBrowserDynamic().bootstrapModule(AppModule) 7 | .catch(err => console.error(err)); 8 | -------------------------------------------------------------------------------- /ui/src/styles.css: -------------------------------------------------------------------------------- 1 | /* You can add global styles to this file, and also import other style files */ 2 | 3 | html, body { height: 100%; } 4 | body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; } 5 | -------------------------------------------------------------------------------- /ui/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/app", 6 | "types": [] 7 | }, 8 | "files": [ 9 | "src/main.ts" 10 | ], 11 | "include": [ 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /ui/tsconfig.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "compileOnSave": false, 4 | "compilerOptions": { 5 | "baseUrl": "./", 6 | "outDir": "./dist/out-tsc", 7 | "forceConsistentCasingInFileNames": true, 8 | "strict": true, 9 | "noImplicitOverride": true, 10 | "noPropertyAccessFromIndexSignature": true, 11 | "noImplicitReturns": true, 12 | "noFallthroughCasesInSwitch": true, 13 | "sourceMap": true, 14 | "declaration": false, 15 | "downlevelIteration": true, 16 | "experimentalDecorators": true, 17 | "moduleResolution": "node", 18 | "importHelpers": true, 19 | "target": "ES2022", 20 | "module": "ES2022", 21 | "useDefineForClassFields": false, 22 | "lib": [ 23 | "ES2022", 24 | "dom" 25 | ] 26 | }, 27 | "angularCompilerOptions": { 28 | "enableI18nLegacyMessageIdFormat": false, 29 | "strictInjectionParameters": true, 30 | "strictInputAccessModifiers": true, 31 | "strictTemplates": true 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ui/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */ 2 | { 3 | "extends": "./tsconfig.json", 4 | "compilerOptions": { 5 | "outDir": "./out-tsc/spec", 6 | "types": [ 7 | "jasmine" 8 | ] 9 | }, 10 | "include": [ 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | --------------------------------------------------------------------------------