@capgo/capacitor-video-player 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapgoCapacitorVideoPlayer.podspec +17 -0
- package/Package.swift +28 -0
- package/README.md +431 -0
- package/android/build.gradle +72 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/capgo/videoplayer/FullscreenExoPlayerFragment.java +1406 -0
- package/android/src/main/java/com/capgo/videoplayer/Notifications/MyRunnable.java +21 -0
- package/android/src/main/java/com/capgo/videoplayer/Notifications/NotificationCenter.java +61 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/AdapterVideoList.java +47 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/ModelVideo.java +49 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/PickerVideoFragment.java +116 -0
- package/android/src/main/java/com/capgo/videoplayer/PickerVideo/VideoRecyclerViewHolder.java +65 -0
- package/android/src/main/java/com/capgo/videoplayer/Utilities/FilesUtils.java +38 -0
- package/android/src/main/java/com/capgo/videoplayer/Utilities/FragmentUtils.java +32 -0
- package/android/src/main/java/com/capgo/videoplayer/VideoPlayer.java +71 -0
- package/android/src/main/java/com/capgo/videoplayer/VideoPlayerPlugin.java +1239 -0
- package/android/src/main/res/.gitkeep +0 -0
- package/android/src/main/res/drawable/bg_round_rect_white_50.xml +9 -0
- package/android/src/main/res/drawable/bg_rounded_rectangle_white_corner_rounded.xml +10 -0
- package/android/src/main/res/drawable/exo_close_btn.xml +12 -0
- package/android/src/main/res/drawable/gradient_transparent_middle.xml +12 -0
- package/android/src/main/res/drawable/ic_arrow_left.xml +5 -0
- package/android/src/main/res/drawable/ic_baseline_lq.xml +7 -0
- package/android/src/main/res/drawable/ic_exo_icon_fastforward.xml +35 -0
- package/android/src/main/res/drawable/ic_exo_icon_pause.xml +26 -0
- package/android/src/main/res/drawable/ic_exo_icon_play.xml +36 -0
- package/android/src/main/res/drawable/ic_exo_icon_rewind.xml +35 -0
- package/android/src/main/res/drawable/ic_expand.xml +5 -0
- package/android/src/main/res/drawable/ic_fit.xml +5 -0
- package/android/src/main/res/drawable/ic_image_background.xml +12 -0
- package/android/src/main/res/drawable/ic_img_16_9_background.xml +10 -0
- package/android/src/main/res/drawable/ic_img_9_16_background.xml +10 -0
- package/android/src/main/res/drawable/ic_outline_lock.xml +5 -0
- package/android/src/main/res/drawable/ic_outline_lock_open.xml +5 -0
- package/android/src/main/res/drawable/ic_pip_white.xml +5 -0
- package/android/src/main/res/drawable/ic_views.xml +18 -0
- package/android/src/main/res/drawable/ic_zoom.xml +5 -0
- package/android/src/main/res/layout/bridge_layout_main.xml +15 -0
- package/android/src/main/res/layout/exo_playback_control_view.xml +287 -0
- package/android/src/main/res/layout/exoplayer_layout_youtube.xml +361 -0
- package/android/src/main/res/layout/fragment_fs_exoplayer.xml +50 -0
- package/android/src/main/res/layout/fragment_picker_video.xml +21 -0
- package/android/src/main/res/layout/row_video.xml +76 -0
- package/android/src/main/res/values/colors.xml +14 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +3 -0
- package/dist/docs.json +686 -0
- package/dist/esm/definitions.d.ts +307 -0
- package/dist/esm/definitions.js +2 -0
- package/dist/esm/definitions.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/web-utils/video-types.d.ts +4 -0
- package/dist/esm/web-utils/video-types.js +9 -0
- package/dist/esm/web-utils/video-types.js.map +1 -0
- package/dist/esm/web-utils/videoplayer.d.ts +30 -0
- package/dist/esm/web-utils/videoplayer.js +323 -0
- package/dist/esm/web-utils/videoplayer.js.map +1 -0
- package/dist/esm/web.d.ts +121 -0
- package/dist/esm/web.js +675 -0
- package/dist/esm/web.js.map +1 -0
- package/dist/plugin.cjs.js +1019 -0
- package/dist/plugin.cjs.js.map +1 -0
- package/dist/plugin.js +1021 -0
- package/dist/plugin.js.map +1 -0
- package/ios/Sources/VideoPlayerPlugin/VideoPlayer.swift +8 -0
- package/ios/Sources/VideoPlayerPlugin/VideoPlayerPlugin.swift +23 -0
- package/ios/Tests/VideoPlayerPluginTests/VideoPlayerPluginTests.swift +15 -0
- package/package.json +85 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'json'
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = 'CapgoCapacitorVideoPlayer'
|
|
7
|
+
s.version = package['version']
|
|
8
|
+
s.summary = package['description']
|
|
9
|
+
s.license = package['license']
|
|
10
|
+
s.homepage = package['repository']['url']
|
|
11
|
+
s.author = package['author']
|
|
12
|
+
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
|
+
s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
|
+
s.dependency 'Capacitor'
|
|
16
|
+
s.swift_version = '5.1'
|
|
17
|
+
end
|
package/Package.swift
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// swift-tools-version: 5.9
|
|
2
|
+
import PackageDescription
|
|
3
|
+
|
|
4
|
+
let package = Package(
|
|
5
|
+
name: "CapgoCapacitorVideoPlayer",
|
|
6
|
+
platforms: [.iOS(.v14)],
|
|
7
|
+
products: [
|
|
8
|
+
.library(
|
|
9
|
+
name: "CapgoCapacitorVideoPlayer",
|
|
10
|
+
targets: ["VideoPlayerPlugin"])
|
|
11
|
+
],
|
|
12
|
+
dependencies: [
|
|
13
|
+
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
|
|
14
|
+
],
|
|
15
|
+
targets: [
|
|
16
|
+
.target(
|
|
17
|
+
name: "VideoPlayerPlugin",
|
|
18
|
+
dependencies: [
|
|
19
|
+
.product(name: "Capacitor", package: "capacitor-swift-pm"),
|
|
20
|
+
.product(name: "Cordova", package: "capacitor-swift-pm")
|
|
21
|
+
],
|
|
22
|
+
path: "ios/Sources/VideoPlayerPlugin"),
|
|
23
|
+
.testTarget(
|
|
24
|
+
name: "VideoPlayerPluginTests",
|
|
25
|
+
dependencies: ["VideoPlayerPlugin"],
|
|
26
|
+
path: "ios/Tests/VideoPlayerPluginTests")
|
|
27
|
+
]
|
|
28
|
+
)
|
package/README.md
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
1
|
+
# @capgo/capacitor-video-player
|
|
2
|
+
<a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
|
|
3
|
+
|
|
4
|
+
<div align="center">
|
|
5
|
+
<h2><a href="https://capgo.app/?ref=plugin"> ➡️ Get Instant updates for your App with Capgo</a></h2>
|
|
6
|
+
<h2><a href="https://capgo.app/consulting/?ref=plugin"> Missing a feature? We’ll build the plugin for you 💪</a></h2>
|
|
7
|
+
</div>
|
|
8
|
+
Native video playback for Capacitor apps
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @capgo/capacitor-video-player
|
|
14
|
+
npx cap sync
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## API
|
|
18
|
+
|
|
19
|
+
<docgen-index>
|
|
20
|
+
|
|
21
|
+
* [`echo(...)`](#echo)
|
|
22
|
+
* [`initPlayer(...)`](#initplayer)
|
|
23
|
+
* [`isPlaying(...)`](#isplaying)
|
|
24
|
+
* [`play(...)`](#play)
|
|
25
|
+
* [`pause(...)`](#pause)
|
|
26
|
+
* [`getDuration(...)`](#getduration)
|
|
27
|
+
* [`getCurrentTime(...)`](#getcurrenttime)
|
|
28
|
+
* [`setCurrentTime(...)`](#setcurrenttime)
|
|
29
|
+
* [`getVolume(...)`](#getvolume)
|
|
30
|
+
* [`setVolume(...)`](#setvolume)
|
|
31
|
+
* [`getMuted(...)`](#getmuted)
|
|
32
|
+
* [`setMuted(...)`](#setmuted)
|
|
33
|
+
* [`setRate(...)`](#setrate)
|
|
34
|
+
* [`getRate(...)`](#getrate)
|
|
35
|
+
* [`stopAllPlayers()`](#stopallplayers)
|
|
36
|
+
* [`showController()`](#showcontroller)
|
|
37
|
+
* [`isControllerIsFullyVisible()`](#iscontrollerisfullyvisible)
|
|
38
|
+
* [`exitPlayer()`](#exitplayer)
|
|
39
|
+
* [Interfaces](#interfaces)
|
|
40
|
+
|
|
41
|
+
</docgen-index>
|
|
42
|
+
|
|
43
|
+
<docgen-api>
|
|
44
|
+
<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
|
|
45
|
+
|
|
46
|
+
### echo(...)
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
echo(options: capEchoOptions) => Promise<capVideoPlayerResult>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Echo
|
|
53
|
+
|
|
54
|
+
| Param | Type |
|
|
55
|
+
| ------------- | --------------------------------------------------------- |
|
|
56
|
+
| **`options`** | <code><a href="#capechooptions">capEchoOptions</a></code> |
|
|
57
|
+
|
|
58
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
59
|
+
|
|
60
|
+
--------------------
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
### initPlayer(...)
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
initPlayer(options: capVideoPlayerOptions) => Promise<capVideoPlayerResult>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Initialize a video player
|
|
70
|
+
|
|
71
|
+
| Param | Type |
|
|
72
|
+
| ------------- | ----------------------------------------------------------------------- |
|
|
73
|
+
| **`options`** | <code><a href="#capvideoplayeroptions">capVideoPlayerOptions</a></code> |
|
|
74
|
+
|
|
75
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
76
|
+
|
|
77
|
+
--------------------
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
### isPlaying(...)
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
isPlaying(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Return if a given playerId is playing
|
|
87
|
+
|
|
88
|
+
| Param | Type |
|
|
89
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
90
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
91
|
+
|
|
92
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
93
|
+
|
|
94
|
+
--------------------
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
### play(...)
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
play(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Play the current video from a given playerId
|
|
104
|
+
|
|
105
|
+
| Param | Type |
|
|
106
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
107
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
108
|
+
|
|
109
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
110
|
+
|
|
111
|
+
--------------------
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
### pause(...)
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
pause(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Pause the current video from a given playerId
|
|
121
|
+
|
|
122
|
+
| Param | Type |
|
|
123
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
124
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
125
|
+
|
|
126
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
127
|
+
|
|
128
|
+
--------------------
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
### getDuration(...)
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
getDuration(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Get the duration of the current video from a given playerId
|
|
138
|
+
|
|
139
|
+
| Param | Type |
|
|
140
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
141
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
142
|
+
|
|
143
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
144
|
+
|
|
145
|
+
--------------------
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### getCurrentTime(...)
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
getCurrentTime(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Get the current time of the current video from a given playerId
|
|
155
|
+
|
|
156
|
+
| Param | Type |
|
|
157
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
158
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
159
|
+
|
|
160
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
161
|
+
|
|
162
|
+
--------------------
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
### setCurrentTime(...)
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
setCurrentTime(options: capVideoTimeOptions) => Promise<capVideoPlayerResult>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Set the current time to seek the current video to from a given playerId
|
|
172
|
+
|
|
173
|
+
| Param | Type |
|
|
174
|
+
| ------------- | ------------------------------------------------------------------- |
|
|
175
|
+
| **`options`** | <code><a href="#capvideotimeoptions">capVideoTimeOptions</a></code> |
|
|
176
|
+
|
|
177
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
178
|
+
|
|
179
|
+
--------------------
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
### getVolume(...)
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
getVolume(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Get the volume of the current video from a given playerId
|
|
189
|
+
|
|
190
|
+
| Param | Type |
|
|
191
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
192
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
193
|
+
|
|
194
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
195
|
+
|
|
196
|
+
--------------------
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### setVolume(...)
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
setVolume(options: capVideoVolumeOptions) => Promise<capVideoPlayerResult>
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Set the volume of the current video to from a given playerId
|
|
206
|
+
|
|
207
|
+
| Param | Type |
|
|
208
|
+
| ------------- | ----------------------------------------------------------------------- |
|
|
209
|
+
| **`options`** | <code><a href="#capvideovolumeoptions">capVideoVolumeOptions</a></code> |
|
|
210
|
+
|
|
211
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
212
|
+
|
|
213
|
+
--------------------
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
### getMuted(...)
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
getMuted(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Get the muted of the current video from a given playerId
|
|
223
|
+
|
|
224
|
+
| Param | Type |
|
|
225
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
226
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
227
|
+
|
|
228
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
229
|
+
|
|
230
|
+
--------------------
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
### setMuted(...)
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
setMuted(options: capVideoMutedOptions) => Promise<capVideoPlayerResult>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Set the muted of the current video to from a given playerId
|
|
240
|
+
|
|
241
|
+
| Param | Type |
|
|
242
|
+
| ------------- | --------------------------------------------------------------------- |
|
|
243
|
+
| **`options`** | <code><a href="#capvideomutedoptions">capVideoMutedOptions</a></code> |
|
|
244
|
+
|
|
245
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
246
|
+
|
|
247
|
+
--------------------
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
### setRate(...)
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
setRate(options: capVideoRateOptions) => Promise<capVideoPlayerResult>
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Set the rate of the current video from a given playerId
|
|
257
|
+
|
|
258
|
+
| Param | Type |
|
|
259
|
+
| ------------- | ------------------------------------------------------------------- |
|
|
260
|
+
| **`options`** | <code><a href="#capvideorateoptions">capVideoRateOptions</a></code> |
|
|
261
|
+
|
|
262
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
263
|
+
|
|
264
|
+
--------------------
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
### getRate(...)
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
getRate(options: capVideoPlayerIdOptions) => Promise<capVideoPlayerResult>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Get the rate of the current video from a given playerId
|
|
274
|
+
|
|
275
|
+
| Param | Type |
|
|
276
|
+
| ------------- | --------------------------------------------------------------------------- |
|
|
277
|
+
| **`options`** | <code><a href="#capvideoplayeridoptions">capVideoPlayerIdOptions</a></code> |
|
|
278
|
+
|
|
279
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
280
|
+
|
|
281
|
+
--------------------
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
### stopAllPlayers()
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
stopAllPlayers() => Promise<capVideoPlayerResult>
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
Stop all players playing
|
|
291
|
+
|
|
292
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
293
|
+
|
|
294
|
+
--------------------
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
### showController()
|
|
298
|
+
|
|
299
|
+
```typescript
|
|
300
|
+
showController() => Promise<capVideoPlayerResult>
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
Show controller
|
|
304
|
+
|
|
305
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
306
|
+
|
|
307
|
+
--------------------
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
### isControllerIsFullyVisible()
|
|
311
|
+
|
|
312
|
+
```typescript
|
|
313
|
+
isControllerIsFullyVisible() => Promise<capVideoPlayerResult>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
isControllerIsFullyVisible
|
|
317
|
+
|
|
318
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
319
|
+
|
|
320
|
+
--------------------
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
### exitPlayer()
|
|
324
|
+
|
|
325
|
+
```typescript
|
|
326
|
+
exitPlayer() => Promise<capVideoPlayerResult>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
Exit player
|
|
330
|
+
|
|
331
|
+
**Returns:** <code>Promise<<a href="#capvideoplayerresult">capVideoPlayerResult</a>></code>
|
|
332
|
+
|
|
333
|
+
--------------------
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
### Interfaces
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
#### capVideoPlayerResult
|
|
340
|
+
|
|
341
|
+
| Prop | Type | Description |
|
|
342
|
+
| ------------- | -------------------- | --------------------------------------------- |
|
|
343
|
+
| **`result`** | <code>boolean</code> | result set to true when successful else false |
|
|
344
|
+
| **`method`** | <code>string</code> | method name |
|
|
345
|
+
| **`value`** | <code>any</code> | value returned |
|
|
346
|
+
| **`message`** | <code>string</code> | message string |
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
#### capEchoOptions
|
|
350
|
+
|
|
351
|
+
| Prop | Type | Description |
|
|
352
|
+
| ----------- | ------------------- | ------------------- |
|
|
353
|
+
| **`value`** | <code>string</code> | String to be echoed |
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
#### capVideoPlayerOptions
|
|
357
|
+
|
|
358
|
+
| Prop | Type | Description |
|
|
359
|
+
| --------------------- | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
360
|
+
| **`mode`** | <code>string</code> | Player mode - "fullscreen" - "embedded" (Web only) |
|
|
361
|
+
| **`url`** | <code>string</code> | The url of the video to play |
|
|
362
|
+
| **`subtitle`** | <code>string</code> | The url of subtitle associated with the video |
|
|
363
|
+
| **`language`** | <code>string</code> | The language of subtitle see https://github.com/libyal/libfwnt/wiki/Language-Code-identifiers |
|
|
364
|
+
| **`subtitleOptions`** | <code><a href="#subtitleoptions">SubTitleOptions</a></code> | SubTitle Options |
|
|
365
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
366
|
+
| **`rate`** | <code>number</code> | Initial playing rate |
|
|
367
|
+
| **`exitOnEnd`** | <code>boolean</code> | Exit on VideoEnd (iOS, Android) default: true |
|
|
368
|
+
| **`loopOnEnd`** | <code>boolean</code> | Loop on VideoEnd when exitOnEnd false (iOS, Android) default: false |
|
|
369
|
+
| **`pipEnabled`** | <code>boolean</code> | Picture in Picture Enable (iOS, Android) default: true |
|
|
370
|
+
| **`bkmodeEnabled`** | <code>boolean</code> | Background Mode Enable (iOS, Android) default: true |
|
|
371
|
+
| **`showControls`** | <code>boolean</code> | Show Controls Enable (iOS, Android) default: true |
|
|
372
|
+
| **`displayMode`** | <code>string</code> | Display Mode ["all", "portrait", "landscape"] (iOS, Android) default: "all" |
|
|
373
|
+
| **`componentTag`** | <code>string</code> | Component Tag or DOM Element Tag (React app) |
|
|
374
|
+
| **`width`** | <code>number</code> | Player Width (mode "embedded" only) |
|
|
375
|
+
| **`height`** | <code>number</code> | Player height (mode "embedded" only) |
|
|
376
|
+
| **`headers`** | <code>{ [key: string]: string; }</code> | Headers for the request (iOS, Android) by Manuel García Marín (https://github.com/PhantomPainX) |
|
|
377
|
+
| **`title`** | <code>string</code> | Title shown in the player (Android) by Manuel García Marín (https://github.com/PhantomPainX) |
|
|
378
|
+
| **`smallTitle`** | <code>string</code> | Subtitle shown below the title in the player (Android) by Manuel García Marín (https://github.com/PhantomPainX) |
|
|
379
|
+
| **`accentColor`** | <code>string</code> | ExoPlayer Progress Bar and Spinner color (Android) by Manuel García Marín (https://github.com/PhantomPainX) Must be a valid hex color code default: #FFFFFF |
|
|
380
|
+
| **`chromecast`** | <code>boolean</code> | Chromecast enable/disable (Android) by Manuel García Marín (https://github.com/PhantomPainX) default: true |
|
|
381
|
+
| **`artwork`** | <code>string</code> | Artwork url to be shown in Chromecast player by Manuel García Marín (https://github.com/PhantomPainX) default: "" |
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
#### SubTitleOptions
|
|
385
|
+
|
|
386
|
+
| Prop | Type | Description |
|
|
387
|
+
| --------------------- | ------------------- | ----------------------------------------------------- |
|
|
388
|
+
| **`foregroundColor`** | <code>string</code> | Foreground Color in RGBA (default rgba(255,255,255,1) |
|
|
389
|
+
| **`backgroundColor`** | <code>string</code> | Background Color in RGBA (default rgba(0,0,0,1) |
|
|
390
|
+
| **`fontSize`** | <code>number</code> | Font Size in pixels (default 16) |
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
#### capVideoPlayerIdOptions
|
|
394
|
+
|
|
395
|
+
| Prop | Type | Description |
|
|
396
|
+
| -------------- | ------------------- | -------------------------------------- |
|
|
397
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
#### capVideoTimeOptions
|
|
401
|
+
|
|
402
|
+
| Prop | Type | Description |
|
|
403
|
+
| -------------- | ------------------- | -------------------------------------- |
|
|
404
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
405
|
+
| **`seektime`** | <code>number</code> | Video time value you want to seek to |
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
#### capVideoVolumeOptions
|
|
409
|
+
|
|
410
|
+
| Prop | Type | Description |
|
|
411
|
+
| -------------- | ------------------- | -------------------------------------- |
|
|
412
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
413
|
+
| **`volume`** | <code>number</code> | Volume value between [0 - 1] |
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
#### capVideoMutedOptions
|
|
417
|
+
|
|
418
|
+
| Prop | Type | Description |
|
|
419
|
+
| -------------- | -------------------- | -------------------------------------- |
|
|
420
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
421
|
+
| **`muted`** | <code>boolean</code> | Muted value true or false |
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
#### capVideoRateOptions
|
|
425
|
+
|
|
426
|
+
| Prop | Type | Description |
|
|
427
|
+
| -------------- | ------------------- | -------------------------------------- |
|
|
428
|
+
| **`playerId`** | <code>string</code> | Id of DIV Element parent of the player |
|
|
429
|
+
| **`rate`** | <code>number</code> | Rate value |
|
|
430
|
+
|
|
431
|
+
</docgen-api>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
ext {
|
|
2
|
+
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
buildscript {
|
|
9
|
+
repositories {
|
|
10
|
+
google()
|
|
11
|
+
mavenCentral()
|
|
12
|
+
}
|
|
13
|
+
dependencies {
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.7.2'
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
apply plugin: 'com.android.library'
|
|
19
|
+
|
|
20
|
+
android {
|
|
21
|
+
namespace "com.capgo.videoplayer"
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
23
|
+
defaultConfig {
|
|
24
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
26
|
+
versionCode 1
|
|
27
|
+
versionName "1.0"
|
|
28
|
+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
29
|
+
}
|
|
30
|
+
buildTypes {
|
|
31
|
+
release {
|
|
32
|
+
minifyEnabled false
|
|
33
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
lintOptions {
|
|
37
|
+
abortOnError false
|
|
38
|
+
}
|
|
39
|
+
compileOptions {
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
repositories {
|
|
46
|
+
google()
|
|
47
|
+
mavenCentral()
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
dependencies {
|
|
52
|
+
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
|
53
|
+
implementation project(':capacitor-android')
|
|
54
|
+
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
|
|
55
|
+
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
|
|
56
|
+
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
|
57
|
+
implementation 'androidx.cardview:cardview:1.0.0'
|
|
58
|
+
implementation 'androidx.gridlayout:gridlayout:1.0.0'
|
|
59
|
+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
|
60
|
+
implementation 'com.google.android.exoplayer:exoplayer-core:2.19.0'
|
|
61
|
+
implementation 'com.google.android.exoplayer:exoplayer-ui:2.19.0'
|
|
62
|
+
implementation 'com.google.android.exoplayer:exoplayer-hls:2.19.0'
|
|
63
|
+
implementation 'com.google.android.exoplayer:exoplayer-dash:2.19.0'
|
|
64
|
+
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.19.0'
|
|
65
|
+
implementation 'com.google.android.exoplayer:extension-mediasession:2.19.0'
|
|
66
|
+
implementation 'com.google.android.exoplayer:exoplayer:2.19.0'
|
|
67
|
+
implementation 'com.google.android.exoplayer:extension-cast:2.19.0'
|
|
68
|
+
implementation 'com.squareup.picasso:picasso:2.8'
|
|
69
|
+
testImplementation "junit:junit:$junitVersion"
|
|
70
|
+
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
|
|
71
|
+
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
|
|
72
|
+
}
|