@nativescript/canvas-media 2.0.0-webgpu.8 → 2.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/audio/common.d.ts +2 -5
- package/audio/common.js +3 -20
- package/audio/common.js.map +1 -1
- package/audio/index.d.ts +2 -3
- package/audio/index.ios.js +3 -2
- package/audio/index.ios.js.map +1 -1
- package/common.d.ts +9 -6
- package/common.js +38 -8
- package/common.js.map +1 -1
- package/index.d.ts +4 -3
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas_media.aar +0 -0
- package/platforms/android/java/org/nativescript/canvas/media/VideoHelper.java +505 -12
- package/platforms/ios/build.xcconfig +1 -0
- package/platforms/ios/src/NSCCanvasMediaUmbrella.h +3 -0
- package/platforms/ios/src/NSCPlayerState.h +23 -0
- package/platforms/ios/src/NSCVideoHelper+Internal.h +26 -0
- package/platforms/ios/src/NSCVideoHelper.h +46 -0
- package/platforms/ios/src/NSCVideoHelper.m +263 -0
- package/platforms/ios/src/NSCVideoHelperListener.h +21 -0
- package/platforms/ios/src/module.modulemap +5 -0
- package/source.d.ts +11 -0
- package/source.js +29 -0
- package/source.js.map +1 -0
- package/video/common.d.ts +5 -11
- package/video/common.js +12 -63
- package/video/common.js.map +1 -1
- package/video/index.android.d.ts +8 -1
- package/video/index.android.js +118 -4
- package/video/index.android.js.map +1 -1
- package/video/index.d.ts +2 -3
- package/video/index.ios.d.ts +18 -21
- package/video/index.ios.js +235 -215
- package/video/index.ios.js.map +1 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCVideoHelper.h
|
|
3
|
+
// CanvasMedia
|
|
4
|
+
//
|
|
5
|
+
// Created by Osei Fortune on 20/05/2025.
|
|
6
|
+
//
|
|
7
|
+
#import <Foundation/Foundation.h>
|
|
8
|
+
#import <AVKit/AVKit.h>
|
|
9
|
+
#import <AVFoundation/AVFoundation.h>
|
|
10
|
+
#import <UIKit/UIKit.h>
|
|
11
|
+
#import <CoreMedia/CoreMedia.h>
|
|
12
|
+
|
|
13
|
+
#import "NSCPlayerState.h"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@protocol NSCVideoHelperListener <NSObject>
|
|
17
|
+
- (void)onVideoFrameCallback;
|
|
18
|
+
- (void)onTimeUpdate:(double)seconds;
|
|
19
|
+
- (void)onStateChange:(NSCPlayerState)state;
|
|
20
|
+
- (void)onLoadedData;
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
@interface NSCVideoHelper : NSObject
|
|
24
|
+
|
|
25
|
+
@property (nonatomic, strong, readonly) AVPlayerViewController *controller;
|
|
26
|
+
@property (nonatomic, strong, readonly) AVPlayer *player;
|
|
27
|
+
@property (nonatomic, strong, readonly) AVPlayerItem *currentItem;
|
|
28
|
+
@property (nonatomic, readonly) BOOL isInForeground;
|
|
29
|
+
@property (nonatomic, readonly) NSCPlayerState state;
|
|
30
|
+
@property (nonatomic, readonly) NSCPlayerReadyState readyState;
|
|
31
|
+
@property (nonatomic, readonly) CGSize videoSize;
|
|
32
|
+
@property (nonatomic, strong, readonly) AVPlayerItemVideoOutput *assetOutput;
|
|
33
|
+
@property (nonatomic, weak) id<NSCVideoHelperListener> listener;
|
|
34
|
+
@property (nonatomic) BOOL loop;
|
|
35
|
+
@property (nonatomic) BOOL autoplay;
|
|
36
|
+
@property (nonatomic) BOOL muted;
|
|
37
|
+
@property (nonatomic) BOOL controls;
|
|
38
|
+
@property (nonatomic) BOOL playsinline;
|
|
39
|
+
@property (nonatomic, copy) NSString *src;
|
|
40
|
+
@property (nonatomic, readonly) double duration;
|
|
41
|
+
@property (nonatomic) double currentTime;
|
|
42
|
+
|
|
43
|
+
- (void)play;
|
|
44
|
+
- (void)pause;
|
|
45
|
+
|
|
46
|
+
@end
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCVideoHelper.m
|
|
3
|
+
// CanvasMedia
|
|
4
|
+
//
|
|
5
|
+
// Created by Osei Fortune on 20/05/2025.
|
|
6
|
+
//
|
|
7
|
+
#import "NSCVideoHelper.h"
|
|
8
|
+
#import "NSCVideoHelper+Internal.h"
|
|
9
|
+
|
|
10
|
+
@implementation NSCVideoHelper
|
|
11
|
+
|
|
12
|
+
- (instancetype)init {
|
|
13
|
+
_isLoop = NO;
|
|
14
|
+
if (self = [super init]) {
|
|
15
|
+
_controller = [[AVPlayerViewController alloc] init];
|
|
16
|
+
_player = [[AVPlayer alloc] init];
|
|
17
|
+
_inForeground = YES;
|
|
18
|
+
_readyState = NSCPlayerReadyStateHaveNothing;
|
|
19
|
+
_state = NSCPlayerStateIdle;
|
|
20
|
+
_controller.player = _player;
|
|
21
|
+
|
|
22
|
+
__weak typeof(self) weakSelf = self;
|
|
23
|
+
_suspendListenerId = [[NSNotificationCenter defaultCenter]
|
|
24
|
+
addObserverForName:UIApplicationDidEnterBackgroundNotification
|
|
25
|
+
object:nil queue:nil
|
|
26
|
+
usingBlock:^(NSNotification *note) {
|
|
27
|
+
weakSelf.inForeground = NO;
|
|
28
|
+
}];
|
|
29
|
+
|
|
30
|
+
_resumeListenerId = [[NSNotificationCenter defaultCenter]
|
|
31
|
+
addObserverForName:UIApplicationDidBecomeActiveNotification
|
|
32
|
+
object:nil queue:nil
|
|
33
|
+
usingBlock:^(NSNotification *note) {
|
|
34
|
+
weakSelf.inForeground = YES;
|
|
35
|
+
}];
|
|
36
|
+
}
|
|
37
|
+
return self;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
-(BOOL) loop {
|
|
41
|
+
return _isLoop;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
- (void)setLoop:(BOOL)loop {
|
|
46
|
+
_isLoop = loop;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
-(BOOL) isInForeground {
|
|
52
|
+
return _inForeground;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
- (void)setSrc:(NSString *)src {
|
|
56
|
+
_currentSrc = src;
|
|
57
|
+
_readyState = NSCPlayerReadyStateHaveNothing;
|
|
58
|
+
self.loadedDataFired = NO;
|
|
59
|
+
|
|
60
|
+
if (!src) return;
|
|
61
|
+
|
|
62
|
+
NSURL *url = [src hasPrefix:@"/"] ? [NSURL fileURLWithPath:src] : [NSURL URLWithString:src];
|
|
63
|
+
if (!url) return;
|
|
64
|
+
|
|
65
|
+
if (_playEndNotificationId) {
|
|
66
|
+
[[NSNotificationCenter defaultCenter] removeObserver:_playEndNotificationId];
|
|
67
|
+
_playEndNotificationId = nil;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
self.asset = [AVURLAsset URLAssetWithURL:url options:nil];
|
|
71
|
+
NSArray *keys = @[@"duration", @"tracks", @"commonMetadata"];
|
|
72
|
+
|
|
73
|
+
__weak typeof(self) weakSelf = self;
|
|
74
|
+
[self.asset loadValuesAsynchronouslyForKeys:keys completionHandler:^{
|
|
75
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
76
|
+
__strong typeof(self) strongSelf = weakSelf;
|
|
77
|
+
if (!strongSelf) return;
|
|
78
|
+
|
|
79
|
+
AVAssetTrack *videoTrack = [[weakSelf.asset tracksWithMediaType:AVMediaTypeVideo] firstObject];
|
|
80
|
+
strongSelf->_videoSize = videoTrack.naturalSize;
|
|
81
|
+
|
|
82
|
+
float fps = videoTrack.nominalFrameRate ?: 30.0;
|
|
83
|
+
CMTime interval = CMTimeMake(1, (int32_t)fps);
|
|
84
|
+
weakSelf.playbackFramesObserver = [weakSelf.player addPeriodicTimeObserverForInterval:interval queue:nil usingBlock:^(CMTime time) {
|
|
85
|
+
if (weakSelf.state == NSCPlayerStatePlaying) {
|
|
86
|
+
[weakSelf.listener onVideoFrameCallback];
|
|
87
|
+
}
|
|
88
|
+
}];
|
|
89
|
+
|
|
90
|
+
AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:weakSelf.asset];
|
|
91
|
+
strongSelf->_currentItem = item;
|
|
92
|
+
|
|
93
|
+
NSDictionary *outputSettings = @{
|
|
94
|
+
(NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA),
|
|
95
|
+
#if !TARGET_OS_SIMULATOR
|
|
96
|
+
(NSString *)kCVPixelBufferIOSurfacePropertiesKey: @{},
|
|
97
|
+
(NSString *)kCVPixelBufferOpenGLESCompatibilityKey: @YES,
|
|
98
|
+
(NSString *)kCVPixelBufferOpenGLCompatibilityKey: @YES,
|
|
99
|
+
#endif
|
|
100
|
+
(NSString *)kCVPixelBufferMetalCompatibilityKey: @YES,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
strongSelf->_assetOutput = [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:outputSettings];
|
|
104
|
+
|
|
105
|
+
[item addObserver:strongSelf forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
|
|
106
|
+
[item addObserver:strongSelf forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial context:nil];
|
|
107
|
+
|
|
108
|
+
strongSelf->_playEndNotificationId = [[NSNotificationCenter defaultCenter]
|
|
109
|
+
addObserverForName:AVPlayerItemDidPlayToEndTimeNotification
|
|
110
|
+
object:item queue:nil usingBlock:^(NSNotification *note) {
|
|
111
|
+
if (weakSelf != NULL && weakSelf.isLoop) {
|
|
112
|
+
[weakSelf.player seekToTime:kCMTimeZero];
|
|
113
|
+
[weakSelf.player play];
|
|
114
|
+
weakSelf.state = NSCPlayerStatePlaying;
|
|
115
|
+
[weakSelf.listener onStateChange:NSCPlayerStatePlaying];
|
|
116
|
+
}
|
|
117
|
+
}];
|
|
118
|
+
|
|
119
|
+
[weakSelf.player replaceCurrentItemWithPlayerItem:item];
|
|
120
|
+
weakSelf.readyState = NSCPlayerReadyStateHaveMetadata;
|
|
121
|
+
[weakSelf performSelectorOnMainThread:@selector(_scheduleFirstFrameCheck) withObject:nil waitUntilDone:NO];
|
|
122
|
+
if (weakSelf.autoplay) {
|
|
123
|
+
[weakSelf play];
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
- (NSString *)src {
|
|
130
|
+
return _currentSrc;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
- (void)observeValueForKeyPath:(NSString *)keyPath
|
|
134
|
+
ofObject:(id)object
|
|
135
|
+
change:(NSDictionary<NSKeyValueChangeKey,id> *)change
|
|
136
|
+
context:(void *)context {
|
|
137
|
+
|
|
138
|
+
if ([keyPath isEqualToString:@"status"]) {
|
|
139
|
+
if (self.player.currentItem.status == AVPlayerItemStatusReadyToPlay) {
|
|
140
|
+
self->_videoSize = [[self.asset tracksWithMediaType:AVMediaTypeVideo] firstObject].naturalSize;
|
|
141
|
+
[self.player.currentItem addOutput:self.assetOutput];
|
|
142
|
+
self.readyState = NSCPlayerReadyStateHaveCurrentData;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
- (void)_scheduleFirstFrameCheck {
|
|
148
|
+
[self _checkForFirstFrameWithAttempts:10 delayMs:50];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
- (void)_checkForFirstFrameWithAttempts:(int)attemptsRemaining delayMs:(int)delayMs {
|
|
152
|
+
if (self.loadedDataFired || attemptsRemaining <= 0) return;
|
|
153
|
+
|
|
154
|
+
CMTime current = [self.player currentTime];
|
|
155
|
+
CVPixelBufferRef buffer = NULL;
|
|
156
|
+
if (self.assetOutput) {
|
|
157
|
+
buffer = [self.assetOutput copyPixelBufferForItemTime:current itemTimeForDisplay:NULL];
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (buffer != NULL) {
|
|
161
|
+
CFRelease(buffer);
|
|
162
|
+
self.loadedDataFired = YES;
|
|
163
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
164
|
+
if ([self.listener respondsToSelector:@selector(onLoadedData)]) {
|
|
165
|
+
[self.listener onLoadedData];
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayMs * NSEC_PER_MSEC)), dispatch_get_main_queue(), ^{
|
|
172
|
+
[self _checkForFirstFrameWithAttempts:attemptsRemaining - 1 delayMs:delayMs];
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
- (double)duration {
|
|
177
|
+
if (!_currentItem) return NAN;
|
|
178
|
+
return CMTimeGetSeconds(_currentItem.asset.duration);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
- (double)currentTime {
|
|
182
|
+
return CMTimeGetSeconds(self.player.currentTime);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
- (void)setCurrentTime:(double)currentTime {
|
|
186
|
+
CMTime time = CMTimeMakeWithSeconds(currentTime, self.player.currentTime.timescale);
|
|
187
|
+
[self.player seekToTime:time];
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
- (BOOL)controls {
|
|
191
|
+
return self.controller.showsPlaybackControls;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
- (void)setControls:(BOOL)controls {
|
|
195
|
+
self.controller.showsPlaybackControls = controls;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
- (BOOL)muted {
|
|
199
|
+
return self.player.muted;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
- (void)setMuted:(BOOL)muted {
|
|
203
|
+
self.player.muted = muted;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
- (BOOL)playsinline {
|
|
207
|
+
return !self.controller.entersFullScreenWhenPlaybackBegins;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
- (void)setPlaysinline:(BOOL)playsinline {
|
|
211
|
+
self.controller.entersFullScreenWhenPlaybackBegins = !playsinline;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
- (void)play {
|
|
215
|
+
if (self.state == NSCPlayerStatePlaying) return;
|
|
216
|
+
[self addTimeObserver];
|
|
217
|
+
[self.player play];
|
|
218
|
+
self.state = NSCPlayerStatePlaying;
|
|
219
|
+
[self.listener onStateChange:self.state];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
- (void)addTimeObserver {
|
|
223
|
+
CMTime interval = CMTimeMake(1, 1);
|
|
224
|
+
__weak typeof(self) weakSelf = self;
|
|
225
|
+
self.playbackTimeObserver = [self.player addPeriodicTimeObserverForInterval:interval queue:nil usingBlock:^(CMTime time) {
|
|
226
|
+
if (weakSelf.state == NSCPlayerStatePlaying) {
|
|
227
|
+
[weakSelf.listener onTimeUpdate:CMTimeGetSeconds(time)];
|
|
228
|
+
}
|
|
229
|
+
}];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
- (void)pause {
|
|
233
|
+
if (self.state != NSCPlayerStatePlaying) return;
|
|
234
|
+
if (self.playbackTimeObserver) {
|
|
235
|
+
[self.player removeTimeObserver:self.playbackTimeObserver];
|
|
236
|
+
self.playbackTimeObserver = nil;
|
|
237
|
+
}
|
|
238
|
+
[self.player pause];
|
|
239
|
+
self.state = NSCPlayerStatePaused;
|
|
240
|
+
[self.listener onStateChange:self.state];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
- (void)dealloc {
|
|
244
|
+
if (self.state == NSCPlayerStatePlaying) {
|
|
245
|
+
[self.player pause];
|
|
246
|
+
self.state = NSCPlayerStateStopped;
|
|
247
|
+
[self.listener onStateChange:self.state];
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
if (_playEndNotificationId) {
|
|
251
|
+
[[NSNotificationCenter defaultCenter] removeObserver:_playEndNotificationId];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (_resumeListenerId) {
|
|
255
|
+
[[NSNotificationCenter defaultCenter] removeObserver:_resumeListenerId];
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (_suspendListenerId) {
|
|
259
|
+
[[NSNotificationCenter defaultCenter] removeObserver:_suspendListenerId];
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
@end
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCVideoHelperListener.h
|
|
3
|
+
// CanvasMedia
|
|
4
|
+
//
|
|
5
|
+
// Created by Osei Fortune on 20/05/2025.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#import <Foundation/Foundation.h>
|
|
9
|
+
#import "NSCPlayerState.h"
|
|
10
|
+
|
|
11
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
12
|
+
|
|
13
|
+
@protocol NSCVideoHelperListener <NSObject>
|
|
14
|
+
|
|
15
|
+
- (void)onStateChange:(NSCPlayerState)state;
|
|
16
|
+
- (void)onTimeUpdate:(double)time;
|
|
17
|
+
- (void)onVideoFrameCallback;
|
|
18
|
+
|
|
19
|
+
@end
|
|
20
|
+
|
|
21
|
+
NS_ASSUME_NONNULL_END
|
package/source.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { View, Property } from '@nativescript/core';
|
|
2
|
+
declare const isSource_: unique symbol;
|
|
3
|
+
export declare class Source extends View {
|
|
4
|
+
src: string;
|
|
5
|
+
type: string;
|
|
6
|
+
[isSource_]: boolean;
|
|
7
|
+
static [Symbol.hasInstance](obj: any): boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const srcProperty: Property<Source, string>;
|
|
10
|
+
export declare const typeProperty: Property<Source, string>;
|
|
11
|
+
export {};
|
package/source.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { View, Property } from '@nativescript/core';
|
|
3
|
+
const isSource_ = Symbol('[[source]]');
|
|
4
|
+
export class Source extends View {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this[_a] = true;
|
|
8
|
+
}
|
|
9
|
+
static [(_a = isSource_, Symbol.hasInstance)](obj) {
|
|
10
|
+
if (obj) {
|
|
11
|
+
if (obj[isSource_]) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if ('src' in obj && 'type' in obj) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export const srcProperty = new Property({
|
|
22
|
+
name: 'src',
|
|
23
|
+
});
|
|
24
|
+
export const typeProperty = new Property({
|
|
25
|
+
name: 'type',
|
|
26
|
+
});
|
|
27
|
+
srcProperty.register(Source);
|
|
28
|
+
typeProperty.register(Source);
|
|
29
|
+
//# sourceMappingURL=source.js.map
|
package/source.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../../../packages/canvas-media/source.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AACpD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;AAEvC,MAAM,OAAO,MAAO,SAAQ,IAAI;IAAhC;;QAGC,QAAW,GAAG,IAAI,CAAC;IAapB,CAAC;IAXA,MAAM,CAAC,OAFN,SAAS,EAEF,MAAM,CAAC,WAAW,EAAC,CAAC,GAAG;QAC9B,IAAI,GAAG,EAAE,CAAC;YACT,IAAI,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;gBACpB,OAAO,IAAI,CAAC;YACb,CAAC;YACD,IAAI,KAAK,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;gBACnC,OAAO,IAAI,CAAC;YACb,CAAC;QACF,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;CACD;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAiB;IACvD,IAAI,EAAE,KAAK;CACX,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,QAAQ,CAAiB;IACxD,IAAI,EAAE,MAAM;CACZ,CAAC,CAAC;AAEH,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAE7B,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC"}
|
package/video/common.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare abstract class VideoBase extends
|
|
1
|
+
import { MediaBase } from '../common';
|
|
2
|
+
export declare abstract class VideoBase extends MediaBase {
|
|
3
3
|
abstract controls: boolean;
|
|
4
4
|
loop: boolean;
|
|
5
5
|
autoplay: boolean;
|
|
@@ -13,6 +13,7 @@ export declare abstract class VideoBase extends ContentView implements AddChildF
|
|
|
13
13
|
static pauseEvent: string;
|
|
14
14
|
static timeupdateEvent: string;
|
|
15
15
|
static durationchangeEvent: string;
|
|
16
|
+
static loadeddataEvent: string;
|
|
16
17
|
static readonly HAVE_NOTHING = 0;
|
|
17
18
|
static readonly HAVE_METADATA = 1;
|
|
18
19
|
static readonly HAVE_CURRENT_DATA = 2;
|
|
@@ -24,7 +25,7 @@ export declare abstract class VideoBase extends ContentView implements AddChildF
|
|
|
24
25
|
height: number;
|
|
25
26
|
};
|
|
26
27
|
private getSize;
|
|
27
|
-
abstract play(): void
|
|
28
|
+
abstract play(): Promise<void>;
|
|
28
29
|
abstract pause(): void;
|
|
29
30
|
_capturedListeners: {};
|
|
30
31
|
_listeners: {};
|
|
@@ -35,13 +36,6 @@ export declare abstract class VideoBase extends ContentView implements AddChildF
|
|
|
35
36
|
removeEventListener(type: string, listener: Function, useCapture: boolean | any): void;
|
|
36
37
|
_videoFrameCallbacks: Function[];
|
|
37
38
|
requestVideoFrameCallback(callback: Function): void;
|
|
39
|
+
cancelVideoFrameCallback(): void;
|
|
38
40
|
_notifyVideoFrameCallbacks(): void;
|
|
39
41
|
}
|
|
40
|
-
export declare const mutedProperty: Property<VideoBase, boolean>;
|
|
41
|
-
export declare const controlsProperty: Property<VideoBase, boolean>;
|
|
42
|
-
export declare const loopProperty: Property<VideoBase, boolean>;
|
|
43
|
-
export declare const autoplayProperty: Property<VideoBase, boolean>;
|
|
44
|
-
export declare const playsinlineProperty: Property<VideoBase, boolean>;
|
|
45
|
-
export declare const srcProperty: Property<VideoBase, string>;
|
|
46
|
-
export declare const currentTimeProperty: Property<VideoBase, number>;
|
|
47
|
-
export declare const durationProperty: Property<VideoBase, number>;
|
package/video/common.js
CHANGED
|
@@ -4,8 +4,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { Screen, Application,
|
|
8
|
-
|
|
7
|
+
import { Screen, Application, Utils, CSSType, PercentLength } from '@nativescript/core';
|
|
8
|
+
import { MediaBase } from '../common';
|
|
9
|
+
let VideoBase = class VideoBase extends MediaBase {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this._capturedListeners = {};
|
|
@@ -151,30 +152,16 @@ let VideoBase = class VideoBase extends ContentView {
|
|
|
151
152
|
removeEventListener(type, listener, useCapture) {
|
|
152
153
|
let isCapture = false;
|
|
153
154
|
if (typeof useCapture === 'boolean') {
|
|
154
|
-
isCapture =
|
|
155
|
+
isCapture = useCapture;
|
|
155
156
|
}
|
|
156
157
|
else if (typeof useCapture === 'object') {
|
|
157
158
|
isCapture = useCapture?.capture ?? false;
|
|
158
159
|
}
|
|
159
160
|
if (isCapture) {
|
|
160
|
-
|
|
161
|
-
if (Array.isArray(this._capturedListeners[type])) {
|
|
162
|
-
this._capturedListeners?.[type]?.push?.(listener);
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
this._capturedListeners[type] = [listener];
|
|
166
|
-
}
|
|
167
|
-
}
|
|
161
|
+
this._removeListener(type, listener, this._capturedListeners);
|
|
168
162
|
}
|
|
169
163
|
else {
|
|
170
|
-
|
|
171
|
-
if (Array.isArray(this._listeners[type])) {
|
|
172
|
-
this._listeners?.[type]?.push?.(listener);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
this._listeners[type] = [listener];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
164
|
+
this._removeListener(type, listener, this._listeners);
|
|
178
165
|
}
|
|
179
166
|
}
|
|
180
167
|
requestVideoFrameCallback(callback) {
|
|
@@ -182,6 +169,11 @@ let VideoBase = class VideoBase extends ContentView {
|
|
|
182
169
|
this._videoFrameCallbacks?.push?.(callback);
|
|
183
170
|
}
|
|
184
171
|
}
|
|
172
|
+
cancelVideoFrameCallback() {
|
|
173
|
+
if (this._videoFrameCallbacks.length > 0) {
|
|
174
|
+
this._videoFrameCallbacks.pop();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
185
177
|
_notifyVideoFrameCallbacks() {
|
|
186
178
|
if (this._videoFrameCallbacks.length !== 0) {
|
|
187
179
|
const toRemove = this._videoFrameCallbacks.length;
|
|
@@ -197,6 +189,7 @@ VideoBase.playEvent = 'play';
|
|
|
197
189
|
VideoBase.pauseEvent = 'pause';
|
|
198
190
|
VideoBase.timeupdateEvent = 'timeupdate';
|
|
199
191
|
VideoBase.durationchangeEvent = 'durationchange';
|
|
192
|
+
VideoBase.loadeddataEvent = 'loadeddata';
|
|
200
193
|
VideoBase.HAVE_NOTHING = 0;
|
|
201
194
|
VideoBase.HAVE_METADATA = 1;
|
|
202
195
|
VideoBase.HAVE_CURRENT_DATA = 2;
|
|
@@ -206,48 +199,4 @@ VideoBase = __decorate([
|
|
|
206
199
|
CSSType('Video')
|
|
207
200
|
], VideoBase);
|
|
208
201
|
export { VideoBase };
|
|
209
|
-
export const mutedProperty = new Property({
|
|
210
|
-
name: 'muted',
|
|
211
|
-
valueConverter: booleanConverter,
|
|
212
|
-
defaultValue: false,
|
|
213
|
-
});
|
|
214
|
-
mutedProperty.register(VideoBase);
|
|
215
|
-
export const controlsProperty = new Property({
|
|
216
|
-
name: 'controls',
|
|
217
|
-
valueConverter: booleanConverter,
|
|
218
|
-
defaultValue: false,
|
|
219
|
-
});
|
|
220
|
-
controlsProperty.register(VideoBase);
|
|
221
|
-
export const loopProperty = new Property({
|
|
222
|
-
name: 'loop',
|
|
223
|
-
valueConverter: booleanConverter,
|
|
224
|
-
defaultValue: false,
|
|
225
|
-
});
|
|
226
|
-
loopProperty.register(VideoBase);
|
|
227
|
-
export const autoplayProperty = new Property({
|
|
228
|
-
name: 'autoplay',
|
|
229
|
-
valueConverter: booleanConverter,
|
|
230
|
-
defaultValue: false,
|
|
231
|
-
});
|
|
232
|
-
autoplayProperty.register(VideoBase);
|
|
233
|
-
export const playsinlineProperty = new Property({
|
|
234
|
-
name: 'playsinline',
|
|
235
|
-
valueConverter: booleanConverter,
|
|
236
|
-
defaultValue: false,
|
|
237
|
-
});
|
|
238
|
-
playsinlineProperty.register(VideoBase);
|
|
239
|
-
export const srcProperty = new Property({
|
|
240
|
-
name: 'src',
|
|
241
|
-
});
|
|
242
|
-
srcProperty.register(VideoBase);
|
|
243
|
-
export const currentTimeProperty = new Property({
|
|
244
|
-
name: 'currentTime',
|
|
245
|
-
defaultValue: 0,
|
|
246
|
-
});
|
|
247
|
-
currentTimeProperty.register(VideoBase);
|
|
248
|
-
export const durationProperty = new Property({
|
|
249
|
-
name: 'duration',
|
|
250
|
-
defaultValue: NaN,
|
|
251
|
-
});
|
|
252
|
-
durationProperty.register(VideoBase);
|
|
253
202
|
//# sourceMappingURL=common.js.map
|
package/video/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../packages/canvas-media/video/common.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../../packages/canvas-media/video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Ae,GAAG,YAAY,AAAf,CAAgB;AACtB,sBAAY,GAAG,CAAC,AAAJ,CAAK;AACjB,uBAAa,GAAG,CAAC,AAAJ,CAAK;AAClB,2BAAiB,GAAG,CAAC,AAAJ,CAAK;AACtB,0BAAgB,GAAG,CAAC,AAAJ,CAAK;AACrB,0BAAgB,GAAG,CAAC,AAAJ,CAAK;AAnBvB,SAAS;IAD9B,OAAO,CAAC,OAAO,CAAC;GACK,SAAS,CAiM9B"}
|
package/video/index.android.d.ts
CHANGED
|
@@ -21,7 +21,14 @@ export declare class Video extends VideoBase {
|
|
|
21
21
|
get readyState(): number;
|
|
22
22
|
static createCustomView(): Video;
|
|
23
23
|
getCurrentFrame(context?: WebGLRenderingContext): void;
|
|
24
|
-
|
|
24
|
+
getFrameForTexImage3D(nativeCtx: any, ctx: any, target: number, level: number, internalformat: number, width: number, height: number, depth: number, border: number, format: number, type: number): void;
|
|
25
|
+
getFrameForTexSubImage3D(nativeCtx: any, ctx: any, target: number, level: number, xoffset: number, yoffset: number, zoffset: number, width: number, height: number, depth: number, format: number, type: number): void;
|
|
26
|
+
drawImageFrame(context2d: any, args: any[]): void;
|
|
27
|
+
getVideoFrameData(): any;
|
|
28
|
+
_playResolve: any;
|
|
29
|
+
_playReject: any;
|
|
30
|
+
_playPromise: Promise<void> | null;
|
|
31
|
+
play(): Promise<void>;
|
|
25
32
|
pause(): void;
|
|
26
33
|
get muted(): boolean;
|
|
27
34
|
set muted(value: boolean);
|