0
我想jwplayer 7.9.2带有空白Ionic2项目整合,但我不能让它正常工作,我有一个错误信息:如何jwplayer V7集成了Ionic2
缺少许可证密钥
基本上,我的分量,我把下面的代码:
有关组件页:
import { Component, AfterViewInit } from '@angular/core';
import { NavController } from 'ionic-angular';
import * as jwplayer from 'jwplayer';
jwplayer.key = "<my_key>";
@Component({
selector: 'page-about',
templateUrl: 'about.html'
})
export class AboutPage implements AfterViewInit {
ngAfterViewInit(): void {
var playerInstance = jwplayer("video");
var options = {
"playlist": [
{
"sources": [
{
"default": false,
"file": "https://wowza.jwplayer.com/live/jelly.stream/playlist.m3u8",
"type": "hls",
"label": "0",
"preload": "none"
}
]
}
],
primary: "html5",
hlshtml: true,
height: 500,
width: '100%'
}
playerInstance.setup(options);
playerInstance.on('ready', function() {
console.log('Player Ready');
playerInstance.play();
})
}
}
About.html
<ion-header>
<ion-navbar>
<ion-title>
About
</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<div id="video"></div>
</ion-content>