How to load External CDN JS to embed JW Player in Nativescript App? #9108
Description
I am using NativeScript with Angular. I want to add JW Player in app to play video for my app.
I already embedded JW Player in Angular Project as follows:-
index.html
<script src="https://cdn.jwplayer.com/libraries/librarykey.js"></script>
home.component.html
<div id="player">This text will be removed.</div>
home.component.ts
`declare var jwplayer: any;
const playerJw = jwplayer('player').setup({
file:'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4',
width: 640,
height: 360,
aspectratio: '16:9',
mute: false,
autostart: true,
primary: 'html5',
});`
I could not figure out how to load JW Player Library in NativeScript. There is no index.html in Nativescript project where I can load the script at the start of application.
How will I load External JS in NativeScript Project? Is there any other way to embed JW Player in Nativescript?
Please help me here.
Activity
triniwiz commentedon Jan 27, 2021
You will need to use the WebView for that
videouser commentedon Feb 3, 2021
Can you please provide an example? Will there be any disadvantage of using webview in Nativescript app?