npm i --save nativescript-vidplayer
- 版本:1.0.7
- GitHub: https://bitbucket.org/win_min_tun/nativescript-vidplayer
- NPM: https://npmjs.net.cn/package/nativescript-vidplayer
- 下载
- 昨日下载量:0
- 上周下载量:0
- 上个月下载量:0
支持全屏的 NativeScript 视频播放器
支持全屏、自动播放、播放完成和错误回调。已测试 mp4、mp3、mov 格式
平台支持
目前仅支持 Android。欢迎任何合作者支持 iOS!
##Android 端
使用方法
该插件使用 nativescript-plugin-seed(https://github.com/NathanWalker/nativescript-plugin-seed)开发。请查看 demo
目录以获取完整示例。
<Video:Vidplayer id="video" src="{{ videoSrc }}" autoPlay="true" onComplete="{{ onComplete }}" onError="{{ onError }}" />
属性
- src - 必需
视频源(在线或本地)
- autoPlay - 可选
自动播放:true/false
- fullScreen - 可选
默认为 true。隐藏/显示全屏按钮
- onComplete - 可选
播放完成回调
- onError - 可选
错误回调(当视频无法播放时)
致谢
感谢 Toshiro(https://github.com/rtoshiro)的 native android 库(https://github.com/rtoshiro/FullscreenVideoView)
贡献 - 支持 iOS 吗?
目前不支持 iOS。欢迎任何建议(iOS 库等)和/或贡献!