YoutubeVideoPlayer插件无法在iOS上运行

时间:2018-12-11 23:03:43

标签: cordova ionic-framework plugins ionic3

嗨,我想使用离子型的本机YoutubeVideoPlayer

我已经添加了这个

ionic cordova plugin add cordova-plugin-youtube-video-player
npm install --save @ionic-native/youtube-video-player

在我的component.html中,我有这个:

<ion-item *ngFor="let video of videos" class="youtube-video-cell"
(tap)="youtube.openVideo(video?.id?.videoId ? video?.id?.videoId : video?.id)">

我为app.module添加了提供程序,并在构造函数中声明了它。

当我点击自己的youtube视频时,我的控制台中会显示以下消息:

Install the YoutubeVideoPlayer plugin: 'ionic cordova plugin add cordova-plugin-youtube-video-player'

我在我的config.xml

中看到了他
<plugin name="cordova-plugin-youtube-video-player" spec="2.1.0" />

你能帮我吗?

1 个答案:

答案 0 :(得分:0)

这些情况通常是由于未正确安装插件引起的。

卸载插件@Named @ViewScoped public class Controller extends GenericWebController { @Inject private Lazy1DataModel lazyModel1; @Inject private Lazy2DataModel lazyModel2; public void onRowSelect(SelectEvent event) throws SQLException { ... filters.put("recordId", arraylistafiltera); ... List<FPromInDto> newlazy = getLazyModel2().load(0,15,null, filters); lazyModel2.setWrappedData(newlazy); } public Lazy1DataModel getLazyModel1() { return lazyModel1; } public void setLazyModel1(Lazy1DataModel lazyModel1) { this.lazyModel1 = lazyModel1; } public Lazy2DataModel getLazyModel2() { return lazyModel2; } public void setLazyModel2(Lazy2DataModel lazyModel2) { this.lazyModel2 = lazyModel2; } }

删除您可能拥有的所有平台,例如public class Lazy2DataModel extends LazyDataModel<SomeDto> { @Inject private SomeDao someDao; @Override public List<SomeDto> load(int first, int pageSize, List<SortMeta> multiSortMeta, Map<String, Object> filters) { List<SomeDto> data = new ArrayList<>(); try { data = someDao.lazyLoad(first, pageSize, BiLazyUtils.getSortString(multiSortMeta, SomeDto.class), BiLazyUtils.getFilterString(filters, SomeDto.class)); this.setRowCount(someDao.count(BiLazyUtils.getFilterString(filters, SomeDto.class))); } catch (SQLException e) { e.printStackTrace(); } return data; }

重新安装插件ionic cordova plugin add cordova-plugin-youtube-video-player

然后在生成内部版本之前添加平台

ionic cordova platform rm android

ionic cordova plugin add cordova-plugin-youtube-video-player