Gathering detailed insights and metrics for essence-ng2-viewer
Gathering detailed insights and metrics for essence-ng2-viewer
Gathering detailed insights and metrics for essence-ng2-viewer
Gathering detailed insights and metrics for essence-ng2-viewer
npm install essence-ng2-viewer
Typescript
Module System
Node Version
NPM Version
72.7
Supply Chain
99.4
Quality
75.2
Maintenance
50
Vulnerability
99.3
License
JavaScript (85.79%)
CSS (7.64%)
HTML (3.49%)
TypeScript (3.07%)
Total Downloads
2,710
Last Day
5
Last Week
8
Last Month
45
Last Year
213
MIT License
13 Stars
39 Commits
4 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Jan 02, 2024
Minified
Minified + Gzipped
Latest Version
4.0.7
Package Id
essence-ng2-viewer@4.0.7
Size
28.13 kB
NPM Version
3.10.10
Node Version
6.10.3
Cumulative downloads
Total Downloads
Last Day
25%
5
Compared to previous day
Last Week
-50%
8
Compared to previous week
Last Month
80%
45
Compared to previous month
Last Year
26%
213
Compared to previous year
2
25
essence-ng2-viewer is an Angular component that can view video/image/pdf.
video-viewer(视频播放器)
支持视频的播放、暂停、快进/退、音量调整等功能
image-viewer(图片查看器)
支持图片的放大、缩小、旋转、翻转、拖动等功能
pdf-viewer(pdf阅读器)
支持pdf的放大、缩小、跳转到指定页、文档搜索、自适应页面、打印等功能
Install
1npm install --save essence-ng2-viewer@latest
Set in the .angular-cli.json(@angular/cli)
1"styles": [ 2 "../node_modules/font-awesome/css/font-awesome.min.css" 3]
Deploy pdfjs (only for pdf-viewer)
要能正常使用pdf-viewer,则需要将构建好的pdfjs部署到服务器上,与要查看的pdf文件为同一个服务器(目前不支持跨域查看)。
检查是否部署成功(根据实际部署的位置):访问http://xxx/pdfjs/web/viewer.html
,能正常访问并加载默认的pdf则说明部署成功。
Add the EssenceNg2ViewerModule
1import {EssenceNg2ViewerModule} from "essence-ng2-viewer"; 2@NgModule({ 3 imports: [ 4 EssenceNg2ViewerModule 5 ] 6})
Template
1<h2>video viewer</h2> 2<essence-ng2-viewer (ready)="videoViewerReady($event)" [model]="'video'" [poster]="poster" [source]="videoUrl" [width]="1000" [height]="700" [videoWidth]="500"></essence-ng2-viewer> 3 4<h2>image viewer</h2> 5<essence-ng2-viewer (ready)="imageViewerReady($event)" [model]="'image'" [source]="images" [width]="1000" [height]="700"></essence-ng2-viewer> 6 7<h2>pdf viewer</h2> 8<essence-ng2-viewer (ready)="pdfViewerReady($event)" [model]="'pdf'" [source]="pdfUrl" [viewerUrl]="pdfViewerUrl" [width]="1000" [height]="700"></essence-ng2-viewer>
Component
1pdfViewerUrl: string = 'http://localhost:4200/assets/scripts/pdfjs/web/viewer.html'; 2pdfUrl: string = 'http://localhost:4200/assets/mock/test.pdf'; 3images: string[] = []; 4videoUrl: string = 'http://localhost:4200/assets/mock/test.mp4'; 5poster: string = 'http://localhost:4200/assets/mock/poster.jpg'; 6 7constructor () { 8 for (let i = 1; i < 13; i++) { 9 this.images.push(`http://localhost:4200/assets/mock/image-viewer/img_${i}.jpg`); 10 } 11} 12 13videoViewerReady ($event: any) { 14 console.log($event); 15} 16 17imageViewerReady ($event: any) { 18 console.log($event); 19} 20 21pdfViewerReady ($event: any) { 22 console.log($event); 23}
model
(?string='pdf'
) - 视图模式,默认pdf
。支持pdf
、image
两种模式,将支持video
模式
width
(?number=600
) - 查看器宽度
video(?number=400)
- video标签的宽度
height
(?number=800
) - 查看器高度
source
(string | string[]
) - 查看的pdf路径、图片文件路径数组及视频路径,pdf
与video
模式下数据类型为string[]
,image
模式下数据类型为string[]
poster
(string
) - 视频预览图(海报图片)路径,video
模式下有效
viewerUrl
(string
) - pdfjs的viewer.html所在路径(pdfjs/web/viewer.html),pdf
模式下有效
ready
- 查看器初始完成的事件```shell
npm install // 安装依赖包
npm start // 启动项目
```
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-05-05
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More