问题描述
我有 Nativescript+Angular 应用程序,我想在其中加载有助于加载播放器的外部 CDN。 如何实现这一目标?有没有办法在 package.json 的依赖项部分加载 URL/CDN?
我问这个是因为 NativeScript 中没有 index.html。如果有像 Angular 应用程序一样的 index.html,那么我可以像下面这样调用 CDN:-
<head>
<script src="CDN_URL_Here"></script>
</head>
package.json
{
"dependencies": {
"@angular/animations": "~8.2.0","@angular/common": "~8.2.0","@angular/compiler": "~8.2.0","nativescript-player": "CDN_URL_Here"
}
}
app.component.ts
import { registerElement,RouterExtensions } from "@nativescript/angular";
registerElement('vidplayer',() => require('nativescript-player'))
sample.component.html
<GridLayout>
<vidplayer [src]="src"></vidplayer>
</GridLayout>
sample.component.ts
export class VidComponent {
constructor() {
this.src.url = "VIDEO_URL_HERE"
}
}
请告诉我正确的方法。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)