1.2.4 • Published 7 years ago

@cdf/cdf-ng-media v1.2.4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

CDF Media UI Module (@cdf/cdf-ng-media)

version downloads

CDF-NG-MEDIA is an Angular module containing UI components for displaying different forms of media (images and/or video). This module simplifies the displaying of media assets. CDF-NG-MEDIA is a UI module existing in Content Delivery Framework's eco-system.

Happy Coding!

npm.io

Requirements

CDF-NG-MEDIA requires the latest version of Angular (at the time of this writing: 2.4.7).

  //package.json
  
  "dependencies": {
    "@angular/common": "2.4.7",
    "@angular/compiler": "2.4.7",
    "@angular/core": "2.4.7",
    "@angular/forms": "2.4.7",
    "@angular/http": "2.4.7",
    "@angular/platform-browser": "2.4.7",
    "@angular/platform-browser-dynamic": "2.4.7",
    "@angular/router": "3.4.7"
	...
  }

CDF-NG-MEDIA also utilizes the following 3rd party sources:

  • JW Player as the vehicle for loading videos. CDF-NG-MEDIA is currently using:
    • JW Player version 7.6.1

Installation

CDF-NG-MEDIA requires a JW Player key in order for JW Player to work correctly. You will need to create an account and establish a JW Player key. You will provide the JW Player Key during configuration. See JW Player for creating an account.

Installing CDF-NG-MEDIA in your Angular application:

    //STEP 1: INSTALL CDF-NG-MEDIA

    npm install @cdf/cdf-ng-media --save

...................................................

    //STEP 2: create a config file (cdf-media-config.ts) to provide configuration settings:

    import { ConfigInterface } from '@cdf/cdf-ng-media/lib';

    export const CdfMediaConfig: ConfigInterface =
      {
        JwPlayerKey: 'YOUR JW PLAYER KEY'
      };

...................................................
  //STEP 3: configure your AppModule:

    // app.module.ts
    import { CdfModule } from '@cdf/cdf-ng/lib';
    import { CdfMediaConfig } from './configs';
    
    @NgModule({
      declarations: [ ... ],
      imports: [
        ...
        //3rd PARTY
        CdfMediaModule.forRoot(CdfMediaConfig),
      ],
      providers: [ ... ],
      bootstrap: [ ... ]
    })
    export class AppModule { }
    

CDF-NG-MEDIA Models

CDF-NG-MEDIA containes the following models needed to show media asset(s):

  • CdfMediaModel
  • CdfVideoModel

CdfMediaModel

CdfMediaModel is the model that contains data about the media asset (image and/or video). CdfMediaModel contains the following data points:

	Id: string;
	Type: string;
	Title: string;
	Description: string;
	ImageUri: string;
	YouTubeId: string;
	VideoList: CdfVideoModel[] = [];
	HasImage: boolean = false;
	HasVideo: boolean = false;  
  • Type can be used to apply a label ontop of the media asset (perfect for a collection of media assets of different types)
  • ImageUri is the complete http URL to an image
  • YouTubeId is the unique value representing a YouTube video (ex. 8geR0yacozY)
  • VideoList is an optional collection of URIs to different videos. This is a placeholder for future functionality

CdfVideoModel

CdfVideoModel is a placeholder data model for future development.

CDF-NG-MEDIA Components

CDF-NG-MEDIA containes the following components you can use:

  • CdfMediaComponent
  • CdfMediaSliderComponent
  • CdfVideoBackgroundComponent

CdfMediaComponent

CdfMediaComponent is the base component used to display either an image or a video. CdfMediaComponent consumes CdfMediaModel which contains all the data necessary to determine if the media asset is a video or an image.

CdfMediaSliderComponent

CdfMediaSliderComponent is a component handling a collection of CdfMediaModels (mix of images and/or videos). CdfMediaSliderComponent arranges the media in a grid. If one of the items is a video, then playing the video will cause an information pane to slide out showing media's title, type, description and a button to click. You can toggle on/off title, type, and description.

<cdf-media-slider [mediaModelList]="mediaModelList" 
    [showType]="showType"
    [showTitle]="showTitle"
    [showDescription]="showDescription"
    (onImageClick)="doMediaClick($event)"></cdf-media-slider>

CdfVideoBackgroundComponent

CdfVideoBackgroundComponent uses JW Player's capability to run a video contained in CdfMediaModel in the background.

Helpful Links

Release History

  • 1.2.0
    • made cdf-media-slider self-contained
  • 1.1.3
    • removed configuration requirement passing in image source URL
  • < 1.0.65
    • Rounds and rounds of trial and error...

Meta

Tom Schreck – @tschreck – tom_schreck@solutiaconsulting.com

https://github.com/tomschreck

License

MIT

1.2.4

7 years ago

1.2.3

7 years ago

1.2.2

7 years ago

1.2.1

7 years ago

1.2.0

7 years ago

1.1.49

7 years ago

1.1.48

7 years ago

1.1.47

7 years ago

1.1.46

7 years ago

1.1.45

7 years ago

1.1.44

7 years ago

1.1.43

7 years ago

1.1.42

7 years ago

1.1.41

7 years ago

1.1.39

7 years ago

1.1.38

7 years ago

1.1.37

7 years ago

1.1.36

7 years ago

1.1.35

7 years ago

1.1.34

7 years ago

1.1.33

7 years ago

1.1.31

7 years ago

1.1.30

7 years ago

1.1.29

7 years ago

1.1.28

7 years ago

1.1.27

7 years ago

1.1.26

7 years ago

1.1.25

7 years ago

1.1.24

7 years ago

1.1.23

7 years ago

1.1.22

7 years ago

1.1.21

7 years ago

1.1.20

7 years ago

1.1.19

7 years ago

1.1.18

7 years ago

1.1.17

7 years ago

1.1.16

7 years ago

1.1.15

7 years ago

1.1.14

7 years ago

1.1.13

7 years ago

1.1.12

7 years ago

1.1.11

7 years ago

1.1.10

7 years ago

1.1.9

7 years ago

1.1.8

7 years ago

1.1.7

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.66

7 years ago

1.0.65

7 years ago

1.0.64

7 years ago

1.0.63

7 years ago

1.0.62

7 years ago

1.0.61

7 years ago

1.0.60

7 years ago

1.0.59

7 years ago

1.0.58

7 years ago

1.0.57

7 years ago

1.0.56

7 years ago

1.0.55

7 years ago

1.0.54

7 years ago

1.0.53

7 years ago

1.0.52

7 years ago

1.0.51

7 years ago

1.0.50

7 years ago

1.0.49

7 years ago

1.0.48

7 years ago

1.0.47

7 years ago

1.0.46

7 years ago

1.0.45

7 years ago

1.0.43

7 years ago

1.0.42

7 years ago

1.0.41

7 years ago

1.0.40

7 years ago

1.0.39

7 years ago

1.0.38

7 years ago

1.0.37

7 years ago

1.0.36

7 years ago

1.0.35

7 years ago

1.0.34

7 years ago

1.0.32

7 years ago

1.0.31

7 years ago

1.0.30

7 years ago

1.0.29

7 years ago

1.0.28

7 years ago

1.0.27

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago