@nativescript/canvas-media 2.0.0-webgpu.30 → 2.0.0-webgpu.33
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/package.json
CHANGED
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCVideoHelper.swift
|
|
3
|
+
// CanvasMedia
|
|
4
|
+
// Created by Osei Fortune on 27/08/24.
|
|
5
|
+
//
|
|
6
|
+
|
|
7
|
+
import Foundation
|
|
8
|
+
import UIKit
|
|
9
|
+
import AVKit
|
|
10
|
+
import AVFoundation
|
|
11
|
+
|
|
12
|
+
// #if canImport(Combine)
|
|
13
|
+
// import Combine
|
|
14
|
+
// #endif
|
|
15
|
+
|
|
16
|
+
@objc(NSCPlayerState)
|
|
17
|
+
public enum NSCPlayerState: Int, RawRepresentable {
|
|
18
|
+
public typealias RawValue = UInt32
|
|
19
|
+
case Idle
|
|
20
|
+
case Playing
|
|
21
|
+
case Paused
|
|
22
|
+
case Stopped
|
|
23
|
+
|
|
24
|
+
public var rawValue: RawValue {
|
|
25
|
+
switch self {
|
|
26
|
+
case .Idle:
|
|
27
|
+
return 0
|
|
28
|
+
case .Playing:
|
|
29
|
+
return 1
|
|
30
|
+
case .Paused:
|
|
31
|
+
return 2
|
|
32
|
+
case .Stopped:
|
|
33
|
+
return 3
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public init?(rawValue: RawValue) {
|
|
38
|
+
switch rawValue {
|
|
39
|
+
case 0:
|
|
40
|
+
self = .Idle
|
|
41
|
+
case 1:
|
|
42
|
+
self = .Playing
|
|
43
|
+
case 2:
|
|
44
|
+
self = .Paused
|
|
45
|
+
case 3:
|
|
46
|
+
self = .Stopped
|
|
47
|
+
default:
|
|
48
|
+
return nil
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@objc(NSCPlayerReadyState)
|
|
55
|
+
public enum NSCPlayerReadyState:Int, RawRepresentable {
|
|
56
|
+
public typealias RawValue = UInt32
|
|
57
|
+
case HAVE_NOTHING
|
|
58
|
+
case HAVE_METADATA
|
|
59
|
+
case HAVE_CURRENT_DATA
|
|
60
|
+
case HAVE_FUTURE_DATA
|
|
61
|
+
case HAVE_ENOUGH_DATA
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
public var rawValue: RawValue {
|
|
65
|
+
switch self {
|
|
66
|
+
case .HAVE_NOTHING:
|
|
67
|
+
return 0
|
|
68
|
+
case .HAVE_METADATA:
|
|
69
|
+
return 1
|
|
70
|
+
case .HAVE_CURRENT_DATA:
|
|
71
|
+
return 2
|
|
72
|
+
case .HAVE_FUTURE_DATA:
|
|
73
|
+
return 3
|
|
74
|
+
case .HAVE_ENOUGH_DATA:
|
|
75
|
+
return 4
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public init?(rawValue: RawValue) {
|
|
80
|
+
switch rawValue {
|
|
81
|
+
case 0:
|
|
82
|
+
self = .HAVE_NOTHING
|
|
83
|
+
case 1:
|
|
84
|
+
self = .HAVE_METADATA
|
|
85
|
+
case 2:
|
|
86
|
+
self = .HAVE_CURRENT_DATA
|
|
87
|
+
case 3:
|
|
88
|
+
self = .HAVE_FUTURE_DATA
|
|
89
|
+
case 4:
|
|
90
|
+
self = .HAVE_ENOUGH_DATA
|
|
91
|
+
default:
|
|
92
|
+
return nil
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@objcMembers
|
|
100
|
+
@objc(NSCVideoHelper)
|
|
101
|
+
public class NSCVideoHelper: NSObject {
|
|
102
|
+
public let controller = AVPlayerViewController()
|
|
103
|
+
public let player = AVPlayer()
|
|
104
|
+
private (set) public var currentItem: AVPlayerItem? = nil
|
|
105
|
+
private var currentSrc: String? = nil
|
|
106
|
+
private(set) public var state: NSCPlayerState = .Idle
|
|
107
|
+
private var asset: AVURLAsset? = nil
|
|
108
|
+
private(set) var videoSize: CGSize = .zero
|
|
109
|
+
private(set) var assetOutput: AVPlayerItemVideoOutput? = nil
|
|
110
|
+
private(set) var readyState: NSCPlayerReadyState = .HAVE_NOTHING
|
|
111
|
+
var listener: NSCVideoHelperListener? = nil
|
|
112
|
+
private(set) var isInForground = true
|
|
113
|
+
public override init(){
|
|
114
|
+
super.init()
|
|
115
|
+
suspendListenerId = NotificationCenter.default.addObserver(forName:UIApplication.didEnterBackgroundNotification , object: nil, queue: nil) { noti in
|
|
116
|
+
self.isInForground = false
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
resumeListenerId = NotificationCenter.default.addObserver(forName:UIApplication.didBecomeActiveNotification , object: nil, queue: nil) { noti in
|
|
120
|
+
self.isInForground = true
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
controller.player = player
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
public override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
|
|
127
|
+
if (keyPath == "status") {
|
|
128
|
+
if(player.currentItem?.status == .failed){
|
|
129
|
+
// let baseError = player.currentItem. .userInfo.objectForKey(NSUnderlyingErrorKey);
|
|
130
|
+
}else if(player.currentItem?.status == .readyToPlay){
|
|
131
|
+
videoSize = asset?.tracks(withMediaType: .video).first?.naturalSize ?? .zero
|
|
132
|
+
player.currentItem?.add(assetOutput!)
|
|
133
|
+
}
|
|
134
|
+
} else if (keyPath == "loadedTimeRanges") {
|
|
135
|
+
|
|
136
|
+
// let playerItem = object as? AVPlayerItem
|
|
137
|
+
// guard let playerItem = playerItem else {return}
|
|
138
|
+
// let ranges = playerItem.loadedTimeRanges
|
|
139
|
+
// guard let first = ranges.first else {return}
|
|
140
|
+
|
|
141
|
+
// let loaded = first.CMTimeRangeValue.duration.value / first.CMTimeRangeValue.duration.timescale
|
|
142
|
+
// let total = playerItem.duration.value / playerItem.duration.timescale
|
|
143
|
+
// console.log('loaded', loaded / total);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
public var controls: Bool {
|
|
148
|
+
get {
|
|
149
|
+
return controller.showsPlaybackControls
|
|
150
|
+
}
|
|
151
|
+
set {
|
|
152
|
+
controller.showsPlaybackControls = newValue
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
public var muted: Bool {
|
|
157
|
+
get {
|
|
158
|
+
return player.isMuted
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
set {
|
|
162
|
+
player.isMuted = newValue
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
public var duration: Double {
|
|
167
|
+
get {
|
|
168
|
+
guard let currentItem = currentItem else {return .nan}
|
|
169
|
+
|
|
170
|
+
return CMTimeGetSeconds(currentItem.asset.duration)
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
public var currentTime: Double {
|
|
175
|
+
get {
|
|
176
|
+
return CMTimeGetSeconds(player.currentTime())
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
set {
|
|
180
|
+
let time = CMTime(seconds: newValue, preferredTimescale: player.currentTime().timescale)
|
|
181
|
+
player.seek(to: time)
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
public var isLoop: Bool = false
|
|
186
|
+
|
|
187
|
+
public var playsinline: Bool {
|
|
188
|
+
get {
|
|
189
|
+
return !controller.entersFullScreenWhenPlaybackBegins
|
|
190
|
+
}
|
|
191
|
+
set {
|
|
192
|
+
controller.entersFullScreenWhenPlaybackBegins = !newValue
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private var playEndNotificationId: Any?
|
|
197
|
+
private var resumeListenerId: Any?
|
|
198
|
+
private var suspendListenerId: Any?
|
|
199
|
+
// private var cancellables = Set<AnyCancellable>()
|
|
200
|
+
public var src: String? {
|
|
201
|
+
get {
|
|
202
|
+
return currentSrc
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
set {
|
|
206
|
+
guard let src = newValue else {
|
|
207
|
+
readyState = .HAVE_NOTHING
|
|
208
|
+
return
|
|
209
|
+
}
|
|
210
|
+
var url: URL?
|
|
211
|
+
if(src.starts(with: "/")){
|
|
212
|
+
url = URL(fileURLWithPath: src)
|
|
213
|
+
}else {
|
|
214
|
+
url = URL(string: src)
|
|
215
|
+
}
|
|
216
|
+
guard let url = url else {
|
|
217
|
+
readyState = .HAVE_NOTHING
|
|
218
|
+
return
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if(playEndNotificationId != nil){
|
|
222
|
+
NotificationCenter.default.removeObserver(playEndNotificationId!)
|
|
223
|
+
playEndNotificationId = nil
|
|
224
|
+
}
|
|
225
|
+
asset = AVURLAsset(url: url)
|
|
226
|
+
|
|
227
|
+
// var cancellables = Set<AnyCancellable>()
|
|
228
|
+
|
|
229
|
+
let keys = ["duration", "tracks", "commonMetadata"]
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
// let publishers = keys.map { key in
|
|
234
|
+
// asset.publisher(for: \.statusOfValue(forKey: key, error: nil))
|
|
235
|
+
// }
|
|
236
|
+
//
|
|
237
|
+
// Publishers.Zip3(publishers[0], publishers[1], publishers[2])
|
|
238
|
+
// .sink { completion in
|
|
239
|
+
// // Handle completion
|
|
240
|
+
// } receiveValue: { status1, status2, status3 in
|
|
241
|
+
// // Handle loaded values for all three keys
|
|
242
|
+
// }
|
|
243
|
+
// .store(in: &cancellables)
|
|
244
|
+
//
|
|
245
|
+
//
|
|
246
|
+
|
|
247
|
+
asset?.loadValuesAsynchronously(forKeys: keys, completionHandler: { [self] in
|
|
248
|
+
videoSize = asset?.tracks(withMediaType: .video).first?.naturalSize ?? .zero
|
|
249
|
+
|
|
250
|
+
let fps = asset?.tracks.first?.nominalFrameRate ?? 30
|
|
251
|
+
let interval = CMTimeMake(value: 1, timescale: Int32(fps))
|
|
252
|
+
|
|
253
|
+
playbackFramesObserver = player.addPeriodicTimeObserver(forInterval: interval, queue: nil, using: { currentTime in
|
|
254
|
+
if(self.state == .Playing){
|
|
255
|
+
self.listener?.onVideoFrameCallback()
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
|
|
259
|
+
currentItem = AVPlayerItem(asset: asset!)
|
|
260
|
+
|
|
261
|
+
guard let currentItem = currentItem else {
|
|
262
|
+
readyState = .HAVE_NOTHING
|
|
263
|
+
currentSrc = nil
|
|
264
|
+
return
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
let attributes: [String: Any] = [
|
|
268
|
+
kCVPixelBufferPixelFormatTypeKey as String: NSNumber(value: kCVPixelFormatType_32BGRA),
|
|
269
|
+
kCVPixelBufferOpenGLESCompatibilityKey as String : NSNumber(value: true),
|
|
270
|
+
kCVPixelBufferOpenGLCompatibilityKey as String : NSNumber(value: true)
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
assetOutput = AVPlayerItemVideoOutput(outputSettings: attributes)
|
|
274
|
+
|
|
275
|
+
currentItem.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status),options: .new,context: nil)
|
|
276
|
+
|
|
277
|
+
currentItem.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.loadedTimeRanges),options: [.initial, .new] ,context: nil)
|
|
278
|
+
|
|
279
|
+
playEndNotificationId = NotificationCenter.default.addObserver(forName: .AVPlayerItemDidPlayToEndTime, object: currentItem, queue: nil, using: { notfi in
|
|
280
|
+
if (self.isLoop) {
|
|
281
|
+
self.player.seek(to: .zero)
|
|
282
|
+
self.player.play()
|
|
283
|
+
self.state = .Playing
|
|
284
|
+
self.listener?.onStateChange(.Playing)
|
|
285
|
+
}
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
player.replaceCurrentItem(with: currentItem)
|
|
290
|
+
|
|
291
|
+
readyState = .HAVE_METADATA
|
|
292
|
+
currentSrc = src
|
|
293
|
+
if (isLoop) {
|
|
294
|
+
play()
|
|
295
|
+
}
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
private var playbackFramesObserver: Any? = nil
|
|
302
|
+
private var playbackTimeObserver: Any? = nil
|
|
303
|
+
private func addTimeObserver() {
|
|
304
|
+
let interval = CMTimeMake(value: 1, timescale: 1)
|
|
305
|
+
player.addPeriodicTimeObserver(forInterval: interval, queue: nil) { currentTime in
|
|
306
|
+
if(self.state == .Playing){
|
|
307
|
+
let seconds = CMTimeGetSeconds(currentTime)
|
|
308
|
+
self.listener?.onTimeUpdate(seconds)
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
public func play(){
|
|
315
|
+
if(state == .Playing){
|
|
316
|
+
return
|
|
317
|
+
}
|
|
318
|
+
addTimeObserver()
|
|
319
|
+
player.play()
|
|
320
|
+
state = .Playing
|
|
321
|
+
listener?.onStateChange(.Playing)
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
public func pause() {
|
|
326
|
+
if (state != .Playing) {
|
|
327
|
+
return
|
|
328
|
+
}
|
|
329
|
+
guard let playbackTimeObserver = playbackTimeObserver else {return}
|
|
330
|
+
player.removeTimeObserver(playbackTimeObserver)
|
|
331
|
+
self.playbackTimeObserver = nil
|
|
332
|
+
player.pause()
|
|
333
|
+
state = .Paused
|
|
334
|
+
listener?.onStateChange(.Paused)
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
deinit {
|
|
338
|
+
if(state == .Playing){
|
|
339
|
+
player.pause()
|
|
340
|
+
state = .Stopped
|
|
341
|
+
listener?.onStateChange(.Stopped)
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if(playEndNotificationId != nil){
|
|
345
|
+
NotificationCenter.default.removeObserver(playEndNotificationId!)
|
|
346
|
+
playEndNotificationId = nil
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
if(resumeListenerId != nil){
|
|
350
|
+
NotificationCenter.default.removeObserver(resumeListenerId!)
|
|
351
|
+
resumeListenerId = nil
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if(suspendListenerId != nil){
|
|
355
|
+
NotificationCenter.default.removeObserver(suspendListenerId!)
|
|
356
|
+
suspendListenerId = nil
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
//
|
|
2
|
+
// NSCVideoHelperListener.swift
|
|
3
|
+
// CanvasMedia
|
|
4
|
+
//
|
|
5
|
+
// Created by Osei Fortune on 28/08/2024.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
import Foundation
|
|
9
|
+
@objc(NSCVideoHelperListener)
|
|
10
|
+
public protocol NSCVideoHelperListener {
|
|
11
|
+
func onStateChange(_ state: NSCPlayerState)
|
|
12
|
+
func onTimeUpdate(_ time: Double)
|
|
13
|
+
func onVideoFrameCallback()
|
|
14
|
+
}
|
package/video/index.ios.d.ts
CHANGED
|
@@ -1,33 +1,23 @@
|
|
|
1
1
|
import { VideoBase } from './common';
|
|
2
|
+
import { Source } from '../common';
|
|
2
3
|
export declare class Video extends VideoBase {
|
|
3
|
-
|
|
4
|
+
helper: any;
|
|
5
|
+
_sourceView: Source[];
|
|
6
|
+
private listener;
|
|
4
7
|
_isCustom: boolean;
|
|
5
|
-
_readyState: number;
|
|
6
|
-
_resumeListenerId: any;
|
|
7
|
-
_suspendListenerId: any;
|
|
8
8
|
_isInForground: boolean;
|
|
9
|
-
_assetOutput: AVPlayerItemVideoOutput;
|
|
10
|
-
_isPlaying: boolean;
|
|
11
|
-
_playEndNotificationId: any;
|
|
12
|
-
_playbackTimeObserver: any;
|
|
13
|
-
_playbackFramesObserver: any;
|
|
14
|
-
_currentUrl: string;
|
|
15
|
-
_fps: number;
|
|
16
9
|
_ctx: any;
|
|
17
|
-
_asset: AVURLAsset;
|
|
18
|
-
_videoSize: any;
|
|
19
|
-
_render: any;
|
|
20
10
|
static IS_DEBUG: boolean;
|
|
21
|
-
get _player():
|
|
11
|
+
get _player(): any;
|
|
22
12
|
constructor();
|
|
23
13
|
static createCustomView(): Video;
|
|
24
|
-
get readyState():
|
|
14
|
+
get readyState(): any;
|
|
25
15
|
getCurrentFrame(context: any): void;
|
|
26
16
|
createNativeView(): Object;
|
|
27
17
|
initNativeView(): void;
|
|
28
18
|
_addChildFromBuilder(name: string, value: any): void;
|
|
29
19
|
onLoaded(): void;
|
|
30
|
-
get duration():
|
|
20
|
+
get duration(): any;
|
|
31
21
|
get currentTime(): number;
|
|
32
22
|
set currentTime(value: number);
|
|
33
23
|
get muted(): boolean;
|
|
@@ -36,11 +26,8 @@ export declare class Video extends VideoBase {
|
|
|
36
26
|
set src(value: string);
|
|
37
27
|
get controls(): boolean;
|
|
38
28
|
set controls(enabled: boolean);
|
|
39
|
-
private _addTimeObserver;
|
|
40
|
-
private _loadSrc;
|
|
41
29
|
play(): void;
|
|
42
30
|
pause(): void;
|
|
43
|
-
_destroy(): void;
|
|
44
31
|
private static get rootViewController();
|
|
45
32
|
private get topViewController();
|
|
46
33
|
private findTopViewController;
|
package/video/index.ios.js
CHANGED
|
@@ -1,114 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _Video_videoCtrl, _Video_player, _Video_sourceView, _Video_protocols, _Video_src, _Video_muted, _Video_controls;
|
|
13
|
-
import { controlsProperty, VideoBase, playsinlineProperty, currentTimeProperty } from './common';
|
|
1
|
+
import { controlsProperty, VideoBase, playsinlineProperty, loopProperty, autoplayProperty } from './common';
|
|
14
2
|
import { Source } from '../common';
|
|
15
3
|
import { knownFolders, path } from '@nativescript/core';
|
|
16
|
-
var
|
|
17
|
-
__extends(
|
|
18
|
-
function
|
|
4
|
+
var NSCVideoHelperListenerImpl = /** @class */ (function (_super) {
|
|
5
|
+
__extends(NSCVideoHelperListenerImpl, _super);
|
|
6
|
+
function NSCVideoHelperListenerImpl() {
|
|
19
7
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
20
8
|
}
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
NSCVideoHelperListenerImpl_1 = NSCVideoHelperListenerImpl;
|
|
10
|
+
NSCVideoHelperListenerImpl.initWithOwner = function (owner) {
|
|
11
|
+
var obj = NSCVideoHelperListenerImpl_1.alloc().init();
|
|
23
12
|
obj._owner = owner;
|
|
24
13
|
return obj;
|
|
25
14
|
};
|
|
26
|
-
|
|
27
|
-
var
|
|
28
|
-
if (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
if (owner._player.currentItem.status === AVPlayerItemStatus.Failed) {
|
|
32
|
-
var baseError = owner._player.currentItem.error.userInfo.objectForKey(NSUnderlyingErrorKey);
|
|
33
|
-
var error = new Error();
|
|
34
|
-
/*error: {
|
|
35
|
-
code: baseError.code,
|
|
36
|
-
domain: baseError.domain
|
|
37
|
-
},
|
|
38
|
-
stack: error.stack
|
|
39
|
-
|
|
40
|
-
*/
|
|
41
|
-
}
|
|
42
|
-
else if (owner._player.currentItem.status === AVPlayerItemStatus.ReadyToPlay) {
|
|
43
|
-
if (!owner._videoSize) {
|
|
44
|
-
owner._videoSize = (_b = (_a = owner._asset.tracksWithMediaType(AVMediaTypeVideo)) === null || _a === void 0 ? void 0 : _a.objectAtIndex(0).naturalSize) !== null && _b !== void 0 ? _b : undefined;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
15
|
+
NSCVideoHelperListenerImpl.prototype.onStateChange = function (state) {
|
|
16
|
+
var owner = this._owner.deref();
|
|
17
|
+
if (owner) {
|
|
18
|
+
if (state === 1) {
|
|
19
|
+
owner._notifyListener(Video.playingEvent);
|
|
47
20
|
}
|
|
48
21
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (first) {
|
|
55
|
-
var loaded = first.CMTimeRangeValue.duration.value / first.CMTimeRangeValue.duration.timescale;
|
|
56
|
-
var total = playerItem.duration.value / playerItem.duration.timescale;
|
|
57
|
-
// console.log('loaded', loaded / total);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
22
|
+
};
|
|
23
|
+
NSCVideoHelperListenerImpl.prototype.onTimeUpdate = function (time) {
|
|
24
|
+
var owner = this._owner.deref();
|
|
25
|
+
if (owner) {
|
|
26
|
+
owner._notifyListener(Video.timeupdateEvent);
|
|
60
27
|
}
|
|
61
28
|
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
var owner = this._owner.get();
|
|
29
|
+
NSCVideoHelperListenerImpl.prototype.onVideoFrameCallback = function () {
|
|
30
|
+
var owner = this._owner.deref();
|
|
65
31
|
if (owner) {
|
|
66
|
-
|
|
67
|
-
NSNotificationCenter.defaultCenter.removeObserver(owner._playEndNotificationId);
|
|
68
|
-
owner._playEndNotificationId = undefined;
|
|
69
|
-
NSNotificationCenter.defaultCenter.removeObserver(owner._resumeListenerId);
|
|
70
|
-
owner._resumeListenerId = undefined;
|
|
71
|
-
NSNotificationCenter.defaultCenter.removeObserver(owner._suspendListenerId);
|
|
72
|
-
owner._suspendListenerId = undefined;
|
|
73
|
-
owner._destroy();
|
|
74
|
-
}
|
|
32
|
+
owner._notifyVideoFrameCallbacks();
|
|
75
33
|
}
|
|
76
34
|
};
|
|
77
|
-
|
|
35
|
+
var NSCVideoHelperListenerImpl_1;
|
|
36
|
+
NSCVideoHelperListenerImpl = NSCVideoHelperListenerImpl_1 = __decorate([
|
|
37
|
+
ObjCClass(NSCVideoHelperListener)
|
|
38
|
+
], NSCVideoHelperListenerImpl);
|
|
39
|
+
return NSCVideoHelperListenerImpl;
|
|
78
40
|
}(NSObject));
|
|
79
41
|
export class Video extends VideoBase {
|
|
80
42
|
get _player() {
|
|
81
|
-
return
|
|
43
|
+
return this.helper.player;
|
|
82
44
|
}
|
|
83
45
|
constructor() {
|
|
84
46
|
super();
|
|
85
|
-
_Video_videoCtrl.set(this, void 0);
|
|
86
|
-
_Video_player.set(this, void 0);
|
|
87
|
-
_Video_sourceView.set(this, void 0);
|
|
88
|
-
_Video_protocols.set(this, void 0);
|
|
89
47
|
this._isCustom = false;
|
|
90
|
-
this._readyState = 0;
|
|
91
48
|
this._isInForground = true;
|
|
92
|
-
this.
|
|
93
|
-
_Video_src.set(this, void 0);
|
|
94
|
-
_Video_muted.set(this, void 0);
|
|
95
|
-
_Video_controls.set(this, void 0);
|
|
96
|
-
__classPrivateFieldSet(this, _Video_videoCtrl, AVPlayerViewController.new(), "f");
|
|
49
|
+
this.helper = NSCVideoHelper.alloc().init();
|
|
97
50
|
try {
|
|
98
51
|
AVAudioSession.sharedInstance().setCategoryError(AVAudioSessionCategoryPlayback);
|
|
99
52
|
}
|
|
100
53
|
catch (e) { }
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
this.setNativeView(__classPrivateFieldGet(this, _Video_videoCtrl, "f").view);
|
|
106
|
-
this._suspendListenerId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(UIApplicationDidEnterBackgroundNotification, null, null, (noti) => {
|
|
107
|
-
this._isInForground = false;
|
|
108
|
-
});
|
|
109
|
-
this._resumeListenerId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(UIApplicationDidBecomeActiveNotification, null, null, (noti) => {
|
|
110
|
-
this._isInForground = true;
|
|
111
|
-
});
|
|
54
|
+
this._sourceView = [];
|
|
55
|
+
this.listener = NSCVideoHelperListenerImpl.initWithOwner(new WeakRef(this));
|
|
56
|
+
this.helper.listener = this.listener;
|
|
57
|
+
this.setNativeView(this.helper.controller.view);
|
|
112
58
|
}
|
|
113
59
|
static createCustomView() {
|
|
114
60
|
const video = new Video();
|
|
@@ -119,19 +65,15 @@ export class Video extends VideoBase {
|
|
|
119
65
|
}
|
|
120
66
|
//@ts-ignore
|
|
121
67
|
get readyState() {
|
|
122
|
-
return this.
|
|
68
|
+
return this.helper.readyState;
|
|
123
69
|
}
|
|
124
70
|
getCurrentFrame(context) {
|
|
125
|
-
if (!this.
|
|
71
|
+
if (!this.helper.isInForground) {
|
|
126
72
|
return;
|
|
127
73
|
}
|
|
128
|
-
if (this.
|
|
74
|
+
if (this.helper.assetOutput) {
|
|
129
75
|
try {
|
|
130
|
-
|
|
131
|
-
this._render = NSCCanvasUtils.setupRender();
|
|
132
|
-
this._render.createSurface();
|
|
133
|
-
}
|
|
134
|
-
NSCCanvasUtils.drawFrame(__classPrivateFieldGet(this, _Video_player, "f"), this._assetOutput, this._videoSize, this._render, arguments[4], arguments[5], false);
|
|
76
|
+
NSCCanvasUtils.drawFrame(this.helper.player, this.helper.assetOutput, this.helper.videoSize, arguments[4], arguments[5], false);
|
|
135
77
|
}
|
|
136
78
|
catch (e) {
|
|
137
79
|
if (Video.IS_DEBUG) {
|
|
@@ -143,172 +85,78 @@ export class Video extends VideoBase {
|
|
|
143
85
|
createNativeView() {
|
|
144
86
|
const ctrl = this.topViewController;
|
|
145
87
|
if (ctrl) {
|
|
146
|
-
ctrl.addChildViewController(
|
|
147
|
-
|
|
88
|
+
ctrl.addChildViewController(this.helper.controller);
|
|
89
|
+
this.helper.controller.didMoveToParentViewController(ctrl);
|
|
148
90
|
}
|
|
149
|
-
return
|
|
91
|
+
return this.helper.controller.view;
|
|
150
92
|
}
|
|
151
93
|
initNativeView() {
|
|
152
94
|
super.initNativeView();
|
|
153
|
-
__classPrivateFieldGet(this, _Video_videoCtrl, "f").showsPlaybackControls = this.controls;
|
|
154
|
-
__classPrivateFieldGet(this, _Video_videoCtrl, "f").entersFullScreenWhenPlaybackBegins = !this.playsinline;
|
|
155
|
-
__classPrivateFieldGet(this, _Video_player, "f").muted = this.muted;
|
|
156
95
|
}
|
|
157
|
-
[
|
|
158
|
-
|
|
96
|
+
[controlsProperty.setNative](enable) {
|
|
97
|
+
this.helper.controls = enable;
|
|
159
98
|
}
|
|
160
99
|
[playsinlineProperty.setNative](inline) {
|
|
161
|
-
|
|
100
|
+
this.helper.playsinline = inline;
|
|
101
|
+
}
|
|
102
|
+
[autoplayProperty.setNative](autoplay) {
|
|
103
|
+
this.helper.autoplay = autoplay;
|
|
162
104
|
}
|
|
163
105
|
_addChildFromBuilder(name, value) {
|
|
164
106
|
if (value instanceof Source) {
|
|
165
|
-
|
|
107
|
+
this._sourceView.push(value);
|
|
166
108
|
}
|
|
167
109
|
}
|
|
168
110
|
onLoaded() {
|
|
169
111
|
super.onLoaded();
|
|
170
|
-
const item =
|
|
112
|
+
const item = this._sourceView.filter((item) => {
|
|
171
113
|
if (item.type.indexOf('video/webm') === -1) {
|
|
172
114
|
return item;
|
|
173
115
|
}
|
|
174
116
|
})[0];
|
|
175
117
|
if (item) {
|
|
176
|
-
this.
|
|
118
|
+
this.helper.src = item.src;
|
|
177
119
|
}
|
|
178
120
|
}
|
|
179
121
|
get duration() {
|
|
180
|
-
|
|
181
|
-
if (currentItem) {
|
|
182
|
-
return CMTimeGetSeconds(currentItem.asset.duration);
|
|
183
|
-
}
|
|
184
|
-
return NaN;
|
|
122
|
+
return this.helper.duration;
|
|
185
123
|
}
|
|
186
124
|
get currentTime() {
|
|
187
|
-
|
|
188
|
-
return ct.value / ct.timescale;
|
|
125
|
+
return this.helper.currentTime;
|
|
189
126
|
}
|
|
190
127
|
set currentTime(value) {
|
|
191
|
-
|
|
192
|
-
__classPrivateFieldGet(this, _Video_player, "f").seekToTime(time);
|
|
128
|
+
this.helper.currentTime = value;
|
|
193
129
|
}
|
|
194
130
|
get muted() {
|
|
195
|
-
return
|
|
131
|
+
return this.helper.muted;
|
|
196
132
|
}
|
|
197
133
|
set muted(value) {
|
|
198
|
-
|
|
199
|
-
__classPrivateFieldGet(this, _Video_player, "f").muted = value;
|
|
134
|
+
this.helper.muted = value;
|
|
200
135
|
}
|
|
201
136
|
get src() {
|
|
202
|
-
return
|
|
137
|
+
return this.helper.src;
|
|
203
138
|
}
|
|
204
139
|
set src(value) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
140
|
+
let src = value;
|
|
141
|
+
if (typeof src === 'string' && src.startsWith('~/')) {
|
|
142
|
+
src = path.join(knownFolders.currentApp().path, src.replace('~', ''));
|
|
208
143
|
}
|
|
144
|
+
this.helper.src = src;
|
|
209
145
|
}
|
|
210
146
|
get controls() {
|
|
211
|
-
return
|
|
147
|
+
return this.helper.controls;
|
|
212
148
|
}
|
|
213
149
|
set controls(enabled) {
|
|
214
|
-
|
|
215
|
-
__classPrivateFieldGet(this, _Video_videoCtrl, "f").showsPlaybackControls = enabled;
|
|
216
|
-
}
|
|
217
|
-
_addTimeObserver() {
|
|
218
|
-
const _interval = CMTimeMake(1, 1);
|
|
219
|
-
this._playbackTimeObserver = __classPrivateFieldGet(this, _Video_player, "f").addPeriodicTimeObserverForIntervalQueueUsingBlock(_interval, null, (currentTime) => {
|
|
220
|
-
if (this._isPlaying) {
|
|
221
|
-
const _seconds = CMTimeGetSeconds(currentTime);
|
|
222
|
-
currentTimeProperty.nativeValueChange(this, _seconds);
|
|
223
|
-
this._notifyListener(Video.timeupdateEvent);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
}
|
|
227
|
-
_loadSrc(value) {
|
|
228
|
-
try {
|
|
229
|
-
const src = value;
|
|
230
|
-
let url;
|
|
231
|
-
if (typeof value === 'string' && value.startsWith('~/')) {
|
|
232
|
-
value = path.join(knownFolders.currentApp().path, value.replace('~', ''));
|
|
233
|
-
}
|
|
234
|
-
if (typeof value === 'string' && value.startsWith('/')) {
|
|
235
|
-
url = NSURL.fileURLWithPath(value);
|
|
236
|
-
}
|
|
237
|
-
if (this._playEndNotificationId) {
|
|
238
|
-
NSNotificationCenter.defaultCenter.removeObserver(this._playEndNotificationId);
|
|
239
|
-
this._playEndNotificationId = undefined;
|
|
240
|
-
}
|
|
241
|
-
if (!url) {
|
|
242
|
-
url = NSURL.URLWithString(value);
|
|
243
|
-
}
|
|
244
|
-
this._asset = AVURLAsset.assetWithURL(url);
|
|
245
|
-
const keys = ['tracks', 'duration'];
|
|
246
|
-
this._asset.loadValuesAsynchronouslyForKeysCompletionHandler(keys, () => {
|
|
247
|
-
this._videoSize = this._asset.tracksWithMediaType(AVMediaTypeVideo)?.objectAtIndex(0).naturalSize ?? undefined;
|
|
248
|
-
const fps = this._asset.tracks.firstObject?.nominalFrameRate ?? 30;
|
|
249
|
-
const _interval = CMTimeMake(1, fps);
|
|
250
|
-
this._playbackFramesObserver = __classPrivateFieldGet(this, _Video_player, "f").addPeriodicTimeObserverForIntervalQueueUsingBlock(_interval, null, (currentTime) => {
|
|
251
|
-
if (this._isPlaying) {
|
|
252
|
-
this._notifyVideoFrameCallbacks();
|
|
253
|
-
}
|
|
254
|
-
});
|
|
255
|
-
this._render?.destroy();
|
|
256
|
-
this._render = undefined;
|
|
257
|
-
const item = AVPlayerItem.alloc().initWithAsset(this._asset);
|
|
258
|
-
const settings = {};
|
|
259
|
-
settings[kCVPixelBufferPixelFormatTypeKey] = NSNumber.numberWithUnsignedInt(kCVPixelFormatType_32BGRA);
|
|
260
|
-
this._assetOutput = AVPlayerItemVideoOutput.alloc().initWithOutputSettings(settings);
|
|
261
|
-
item.addOutput(this._assetOutput);
|
|
262
|
-
item.addObserverForKeyPathOptionsContext(__classPrivateFieldGet(this, _Video_protocols, "f"), 'status', 1 /* NSKeyValueObservingOptions.New */, null);
|
|
263
|
-
item.addObserverForKeyPathOptionsContext(__classPrivateFieldGet(this, _Video_protocols, "f"), 'loadedTimeRanges', 4 /* NSKeyValueObservingOptions.Initial */ | 1 /* NSKeyValueObservingOptions.New */, null);
|
|
264
|
-
this._playEndNotificationId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(AVPlayerItemDidPlayToEndTimeNotification, item, null, (notfi) => {
|
|
265
|
-
if (this.loop) {
|
|
266
|
-
__classPrivateFieldGet(this, _Video_player, "f").seekToTime(kCMTimeZero);
|
|
267
|
-
__classPrivateFieldGet(this, _Video_player, "f").play();
|
|
268
|
-
this._isPlaying = true;
|
|
269
|
-
this._notifyListener(Video.playingEvent);
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
__classPrivateFieldGet(this, _Video_player, "f").replaceCurrentItemWithPlayerItem(item);
|
|
273
|
-
this._readyState = Video.HAVE_METADATA;
|
|
274
|
-
this._currentUrl = src;
|
|
275
|
-
if (this.autoplay) {
|
|
276
|
-
this.play();
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
}
|
|
280
|
-
catch (e) {
|
|
281
|
-
console.log('_loadSrc', e);
|
|
282
|
-
}
|
|
150
|
+
this.helper.controls = enabled;
|
|
283
151
|
}
|
|
284
152
|
play() {
|
|
285
|
-
|
|
286
|
-
return;
|
|
287
|
-
}
|
|
288
|
-
this._addTimeObserver();
|
|
289
|
-
__classPrivateFieldGet(this, _Video_player, "f").play();
|
|
290
|
-
this._isPlaying = true;
|
|
291
|
-
this._notifyListener(Video.playingEvent);
|
|
153
|
+
this.helper.play();
|
|
292
154
|
}
|
|
293
155
|
pause() {
|
|
294
|
-
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
if (this._playbackTimeObserver) {
|
|
298
|
-
__classPrivateFieldGet(this, _Video_player, "f").removeTimeObserver(this._playbackTimeObserver);
|
|
299
|
-
this._playbackTimeObserver = undefined;
|
|
300
|
-
}
|
|
301
|
-
/*
|
|
302
|
-
if (this._playbackTimeObserver) {
|
|
303
|
-
this.#player.removeTimeObserver(this._playbackTimeObserver);
|
|
304
|
-
this._playbackTimeObserver = undefined;
|
|
305
|
-
}
|
|
306
|
-
*/
|
|
307
|
-
__classPrivateFieldGet(this, _Video_player, "f").pause();
|
|
308
|
-
this._isPlaying = false;
|
|
156
|
+
this.helper.pause();
|
|
309
157
|
}
|
|
310
|
-
|
|
311
|
-
|
|
158
|
+
[loopProperty.setNative](value) {
|
|
159
|
+
this.helper.isLoop = value;
|
|
312
160
|
}
|
|
313
161
|
static get rootViewController() {
|
|
314
162
|
const keyWindow = UIApplication.sharedApplication.keyWindow;
|
|
@@ -353,4 +201,343 @@ export class Video extends VideoBase {
|
|
|
353
201
|
}
|
|
354
202
|
}
|
|
355
203
|
Video.IS_DEBUG = false;
|
|
204
|
+
// @NativeClass()
|
|
205
|
+
// class NativeObject extends NSObject {
|
|
206
|
+
// _owner: WeakRef<Video>;
|
|
207
|
+
// public static initWithOwner(owner: WeakRef<Video>): NativeObject {
|
|
208
|
+
// const obj = NativeObject.alloc().init() as NativeObject;
|
|
209
|
+
// obj._owner = owner;
|
|
210
|
+
// return obj;
|
|
211
|
+
// }
|
|
212
|
+
// observeValueForKeyPathOfObjectChangeContext(path: string, obj: Object, change: NSDictionary<any, any>, context: any) {
|
|
213
|
+
// if (path === 'status') {
|
|
214
|
+
// const owner = this._owner.get();
|
|
215
|
+
// if (owner) {
|
|
216
|
+
// if (owner._player.currentItem.status === AVPlayerItemStatus.Failed) {
|
|
217
|
+
// const baseError = owner._player.currentItem.error.userInfo.objectForKey(NSUnderlyingErrorKey);
|
|
218
|
+
// const error = new Error();
|
|
219
|
+
// /*error: {
|
|
220
|
+
// code: baseError.code,
|
|
221
|
+
// domain: baseError.domain
|
|
222
|
+
// },
|
|
223
|
+
// stack: error.stack
|
|
224
|
+
// */
|
|
225
|
+
// } else if (owner._player.currentItem.status === AVPlayerItemStatus.ReadyToPlay) {
|
|
226
|
+
// if (!owner._videoSize) {
|
|
227
|
+
// owner._videoSize = owner._asset.tracksWithMediaType(AVMediaTypeVideo)?.objectAtIndex(0).naturalSize ?? undefined;
|
|
228
|
+
// }
|
|
229
|
+
// }
|
|
230
|
+
// }
|
|
231
|
+
// } else if (path === 'loadedTimeRanges') {
|
|
232
|
+
// const playerItem = obj as AVPlayerItem;
|
|
233
|
+
// if (playerItem) {
|
|
234
|
+
// const ranges = playerItem.loadedTimeRanges;
|
|
235
|
+
// const first = ranges?.firstObject as NSValue;
|
|
236
|
+
// if (first) {
|
|
237
|
+
// let loaded = first.CMTimeRangeValue.duration.value / first.CMTimeRangeValue.duration.timescale;
|
|
238
|
+
// let total = playerItem.duration.value / playerItem.duration.timescale;
|
|
239
|
+
// // console.log('loaded', loaded / total);
|
|
240
|
+
// }
|
|
241
|
+
// }
|
|
242
|
+
// }
|
|
243
|
+
// }
|
|
244
|
+
// dealloc() {
|
|
245
|
+
// // using this to clean up listeners
|
|
246
|
+
// const owner = this._owner.get();
|
|
247
|
+
// if (owner) {
|
|
248
|
+
// if (owner._playEndNotificationId) {
|
|
249
|
+
// NSNotificationCenter.defaultCenter.removeObserver(owner._playEndNotificationId);
|
|
250
|
+
// owner._playEndNotificationId = undefined;
|
|
251
|
+
// NSNotificationCenter.defaultCenter.removeObserver(owner._resumeListenerId);
|
|
252
|
+
// owner._resumeListenerId = undefined;
|
|
253
|
+
// NSNotificationCenter.defaultCenter.removeObserver(owner._suspendListenerId);
|
|
254
|
+
// owner._suspendListenerId = undefined;
|
|
255
|
+
// owner._destroy();
|
|
256
|
+
// }
|
|
257
|
+
// }
|
|
258
|
+
// }
|
|
259
|
+
// }
|
|
260
|
+
// export class Video extends VideoBase {
|
|
261
|
+
// #videoCtrl: AVPlayerViewController;
|
|
262
|
+
// #player: AVPlayer;
|
|
263
|
+
// #sourceView: Source[];
|
|
264
|
+
// #protocols: NativeObject;
|
|
265
|
+
// _isCustom: boolean = false;
|
|
266
|
+
// _readyState: number = 0;
|
|
267
|
+
// _resumeListenerId: any;
|
|
268
|
+
// _suspendListenerId: any;
|
|
269
|
+
// _isInForground = true;
|
|
270
|
+
// _assetOutput: AVPlayerItemVideoOutput;
|
|
271
|
+
// _isPlaying = false;
|
|
272
|
+
// #src: string;
|
|
273
|
+
// #muted: boolean;
|
|
274
|
+
// #controls: boolean;
|
|
275
|
+
// _playEndNotificationId: any;
|
|
276
|
+
// _playbackTimeObserver: any;
|
|
277
|
+
// _playbackFramesObserver: any;
|
|
278
|
+
// _currentUrl: string;
|
|
279
|
+
// _fps: number;
|
|
280
|
+
// _ctx: any;
|
|
281
|
+
// _asset: AVURLAsset;
|
|
282
|
+
// _videoSize: any;
|
|
283
|
+
// _render: any;
|
|
284
|
+
// static IS_DEBUG = false;
|
|
285
|
+
// get _player() {
|
|
286
|
+
// return this.#player;
|
|
287
|
+
// }
|
|
288
|
+
// constructor() {
|
|
289
|
+
// super();
|
|
290
|
+
// this.#videoCtrl = AVPlayerViewController.new();
|
|
291
|
+
// try {
|
|
292
|
+
// AVAudioSession.sharedInstance().setCategoryError(AVAudioSessionCategoryPlayback);
|
|
293
|
+
// } catch (e) {}
|
|
294
|
+
// this.#player = AVPlayer.new();
|
|
295
|
+
// this.#videoCtrl.player = this.#player;
|
|
296
|
+
// this.#sourceView = [];
|
|
297
|
+
// this.#protocols = NativeObject.initWithOwner(new WeakRef(this));
|
|
298
|
+
// this.setNativeView(this.#videoCtrl.view);
|
|
299
|
+
// this._suspendListenerId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(UIApplicationDidEnterBackgroundNotification, null, null, (noti) => {
|
|
300
|
+
// this._isInForground = false;
|
|
301
|
+
// });
|
|
302
|
+
// this._resumeListenerId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(UIApplicationDidBecomeActiveNotification, null, null, (noti) => {
|
|
303
|
+
// this._isInForground = true;
|
|
304
|
+
// });
|
|
305
|
+
// }
|
|
306
|
+
// static createCustomView() {
|
|
307
|
+
// const video = new Video();
|
|
308
|
+
// video._isCustom = true;
|
|
309
|
+
// video.width = 300;
|
|
310
|
+
// video.height = 150;
|
|
311
|
+
// return video;
|
|
312
|
+
// }
|
|
313
|
+
// //@ts-ignore
|
|
314
|
+
// get readyState() {
|
|
315
|
+
// return this._readyState;
|
|
316
|
+
// }
|
|
317
|
+
// getCurrentFrame(context) {
|
|
318
|
+
// if (!this._isInForground) {
|
|
319
|
+
// return;
|
|
320
|
+
// }
|
|
321
|
+
// if (this._assetOutput) {
|
|
322
|
+
// try {
|
|
323
|
+
// if (!this._render) {
|
|
324
|
+
// this._render = NSCCanvasUtils.setupRender();
|
|
325
|
+
// this._render.createSurface();
|
|
326
|
+
// }
|
|
327
|
+
// NSCCanvasUtils.drawFrame(this.#player, this._assetOutput, this._videoSize, this._render, arguments[4], arguments[5], false);
|
|
328
|
+
// } catch (e) {
|
|
329
|
+
// if (Video.IS_DEBUG) {
|
|
330
|
+
// console.error('getCurrentFrame error:', e);
|
|
331
|
+
// }
|
|
332
|
+
// }
|
|
333
|
+
// }
|
|
334
|
+
// }
|
|
335
|
+
// createNativeView(): Object {
|
|
336
|
+
// const ctrl = this.topViewController;
|
|
337
|
+
// if (ctrl) {
|
|
338
|
+
// ctrl.addChildViewController(this.#videoCtrl);
|
|
339
|
+
// this.#videoCtrl.didMoveToParentViewController(ctrl);
|
|
340
|
+
// }
|
|
341
|
+
// return this.#videoCtrl.view;
|
|
342
|
+
// }
|
|
343
|
+
// initNativeView() {
|
|
344
|
+
// super.initNativeView();
|
|
345
|
+
// this.#videoCtrl.showsPlaybackControls = this.controls;
|
|
346
|
+
// this.#videoCtrl.entersFullScreenWhenPlaybackBegins = !this.playsinline;
|
|
347
|
+
// this.#player.muted = this.muted;
|
|
348
|
+
// }
|
|
349
|
+
// [controlsProperty.setNative](enable: boolean) {
|
|
350
|
+
// this.#videoCtrl.showsPlaybackControls = enable;
|
|
351
|
+
// }
|
|
352
|
+
// [playsinlineProperty.setNative](inline: boolean) {
|
|
353
|
+
// this.#videoCtrl.entersFullScreenWhenPlaybackBegins = !inline;
|
|
354
|
+
// }
|
|
355
|
+
// _addChildFromBuilder(name: string, value: any) {
|
|
356
|
+
// if (value instanceof Source) {
|
|
357
|
+
// this.#sourceView.push(value);
|
|
358
|
+
// }
|
|
359
|
+
// }
|
|
360
|
+
// onLoaded() {
|
|
361
|
+
// super.onLoaded();
|
|
362
|
+
// const item = this.#sourceView.filter((item) => {
|
|
363
|
+
// if (item.type.indexOf('video/webm') === -1) {
|
|
364
|
+
// return item;
|
|
365
|
+
// }
|
|
366
|
+
// })[0];
|
|
367
|
+
// if (item) {
|
|
368
|
+
// this._loadSrc(item.src);
|
|
369
|
+
// }
|
|
370
|
+
// }
|
|
371
|
+
// get duration() {
|
|
372
|
+
// const currentItem = this.#player.currentItem;
|
|
373
|
+
// if (currentItem) {
|
|
374
|
+
// return CMTimeGetSeconds(currentItem.asset.duration);
|
|
375
|
+
// }
|
|
376
|
+
// return NaN;
|
|
377
|
+
// }
|
|
378
|
+
// get currentTime() {
|
|
379
|
+
// const ct = this.#player.currentTime();
|
|
380
|
+
// return ct.value / ct.timescale;
|
|
381
|
+
// }
|
|
382
|
+
// set currentTime(value: number) {
|
|
383
|
+
// const time = CMTimeMakeWithSeconds(value, this.#player.currentTime().timescale);
|
|
384
|
+
// this.#player.seekToTime(time);
|
|
385
|
+
// }
|
|
386
|
+
// get muted() {
|
|
387
|
+
// return this.#muted;
|
|
388
|
+
// }
|
|
389
|
+
// set muted(value: boolean) {
|
|
390
|
+
// this.#muted = value;
|
|
391
|
+
// this.#player.muted = value;
|
|
392
|
+
// }
|
|
393
|
+
// get src() {
|
|
394
|
+
// return this.#src;
|
|
395
|
+
// }
|
|
396
|
+
// set src(value: string) {
|
|
397
|
+
// if (value !== this._currentUrl) {
|
|
398
|
+
// this.#src = value;
|
|
399
|
+
// this._loadSrc(value);
|
|
400
|
+
// }
|
|
401
|
+
// }
|
|
402
|
+
// get controls() {
|
|
403
|
+
// return this.#controls;
|
|
404
|
+
// }
|
|
405
|
+
// set controls(enabled: boolean) {
|
|
406
|
+
// this.#controls = enabled;
|
|
407
|
+
// this.#videoCtrl.showsPlaybackControls = enabled;
|
|
408
|
+
// }
|
|
409
|
+
// private _addTimeObserver() {
|
|
410
|
+
// const _interval = CMTimeMake(1, 1);
|
|
411
|
+
// this._playbackTimeObserver = this.#player.addPeriodicTimeObserverForIntervalQueueUsingBlock(_interval, null, (currentTime) => {
|
|
412
|
+
// if (this._isPlaying) {
|
|
413
|
+
// const _seconds = CMTimeGetSeconds(currentTime);
|
|
414
|
+
// currentTimeProperty.nativeValueChange(this, _seconds);
|
|
415
|
+
// this._notifyListener(Video.timeupdateEvent);
|
|
416
|
+
// }
|
|
417
|
+
// });
|
|
418
|
+
// }
|
|
419
|
+
// private _loadSrc(value: string) {
|
|
420
|
+
// try {
|
|
421
|
+
// const src = value;
|
|
422
|
+
// let url;
|
|
423
|
+
// if (typeof value === 'string' && value.startsWith('~/')) {
|
|
424
|
+
// value = path.join(knownFolders.currentApp().path, value.replace('~', ''));
|
|
425
|
+
// }
|
|
426
|
+
// if (typeof value === 'string' && value.startsWith('/')) {
|
|
427
|
+
// url = NSURL.fileURLWithPath(value);
|
|
428
|
+
// }
|
|
429
|
+
// if (this._playEndNotificationId) {
|
|
430
|
+
// NSNotificationCenter.defaultCenter.removeObserver(this._playEndNotificationId);
|
|
431
|
+
// this._playEndNotificationId = undefined;
|
|
432
|
+
// }
|
|
433
|
+
// if (!url) {
|
|
434
|
+
// url = NSURL.URLWithString(value);
|
|
435
|
+
// }
|
|
436
|
+
// this._asset = AVURLAsset.assetWithURL(url);
|
|
437
|
+
// const keys = ['tracks', 'duration'];
|
|
438
|
+
// this._asset.loadValuesAsynchronouslyForKeysCompletionHandler(keys, () => {
|
|
439
|
+
// this._videoSize = this._asset.tracksWithMediaType(AVMediaTypeVideo)?.objectAtIndex(0).naturalSize ?? undefined;
|
|
440
|
+
// const fps = this._asset.tracks.firstObject?.nominalFrameRate ?? 30;
|
|
441
|
+
// const _interval = CMTimeMake(1, fps);
|
|
442
|
+
// this._playbackFramesObserver = this.#player.addPeriodicTimeObserverForIntervalQueueUsingBlock(_interval, null, (currentTime) => {
|
|
443
|
+
// if (this._isPlaying) {
|
|
444
|
+
// this._notifyVideoFrameCallbacks();
|
|
445
|
+
// }
|
|
446
|
+
// });
|
|
447
|
+
// this._render?.destroy();
|
|
448
|
+
// this._render = undefined;
|
|
449
|
+
// const item = AVPlayerItem.alloc().initWithAsset(this._asset);
|
|
450
|
+
// const settings: any = {};
|
|
451
|
+
// settings[kCVPixelBufferPixelFormatTypeKey] = NSNumber.numberWithUnsignedInt(kCVPixelFormatType_32BGRA);
|
|
452
|
+
// this._assetOutput = AVPlayerItemVideoOutput.alloc().initWithOutputSettings(settings);
|
|
453
|
+
// item.addOutput(this._assetOutput);
|
|
454
|
+
// item.addObserverForKeyPathOptionsContext(this.#protocols, 'status', NSKeyValueObservingOptions.New, null);
|
|
455
|
+
// item.addObserverForKeyPathOptionsContext(this.#protocols, 'loadedTimeRanges', NSKeyValueObservingOptions.Initial | NSKeyValueObservingOptions.New, null);
|
|
456
|
+
// this._playEndNotificationId = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(AVPlayerItemDidPlayToEndTimeNotification, item, null, (notfi) => {
|
|
457
|
+
// if (this.loop) {
|
|
458
|
+
// this.#player.seekToTime(kCMTimeZero);
|
|
459
|
+
// this.#player.play();
|
|
460
|
+
// this._isPlaying = true;
|
|
461
|
+
// this._notifyListener(Video.playingEvent);
|
|
462
|
+
// }
|
|
463
|
+
// });
|
|
464
|
+
// this.#player.replaceCurrentItemWithPlayerItem(item);
|
|
465
|
+
// this._readyState = Video.HAVE_METADATA;
|
|
466
|
+
// this._currentUrl = src;
|
|
467
|
+
// if (this.autoplay) {
|
|
468
|
+
// this.play();
|
|
469
|
+
// }
|
|
470
|
+
// });
|
|
471
|
+
// } catch (e) {
|
|
472
|
+
// console.log('_loadSrc', e);
|
|
473
|
+
// }
|
|
474
|
+
// }
|
|
475
|
+
// play() {
|
|
476
|
+
// if (this._isPlaying) {
|
|
477
|
+
// return;
|
|
478
|
+
// }
|
|
479
|
+
// this._addTimeObserver();
|
|
480
|
+
// this.#player.play();
|
|
481
|
+
// this._isPlaying = true;
|
|
482
|
+
// this._notifyListener(Video.playingEvent);
|
|
483
|
+
// }
|
|
484
|
+
// pause() {
|
|
485
|
+
// if (!this._isPlaying) {
|
|
486
|
+
// return;
|
|
487
|
+
// }
|
|
488
|
+
// if (this._playbackTimeObserver) {
|
|
489
|
+
// this.#player.removeTimeObserver(this._playbackTimeObserver);
|
|
490
|
+
// this._playbackTimeObserver = undefined;
|
|
491
|
+
// }
|
|
492
|
+
// /*
|
|
493
|
+
// if (this._playbackTimeObserver) {
|
|
494
|
+
// this.#player.removeTimeObserver(this._playbackTimeObserver);
|
|
495
|
+
// this._playbackTimeObserver = undefined;
|
|
496
|
+
// }
|
|
497
|
+
// */
|
|
498
|
+
// this.#player.pause();
|
|
499
|
+
// this._isPlaying = false;
|
|
500
|
+
// }
|
|
501
|
+
// _destroy() {
|
|
502
|
+
// this.#player.pause();
|
|
503
|
+
// }
|
|
504
|
+
// private static get rootViewController(): UIViewController | undefined {
|
|
505
|
+
// const keyWindow = UIApplication.sharedApplication.keyWindow;
|
|
506
|
+
// return keyWindow != null ? keyWindow.rootViewController : undefined;
|
|
507
|
+
// }
|
|
508
|
+
// private get topViewController(): UIViewController | undefined {
|
|
509
|
+
// const root = Video.rootViewController;
|
|
510
|
+
// if (root == null) {
|
|
511
|
+
// return undefined;
|
|
512
|
+
// }
|
|
513
|
+
// return this.findTopViewController(root);
|
|
514
|
+
// }
|
|
515
|
+
// private findTopViewController(root: UIViewController): UIViewController | undefined {
|
|
516
|
+
// const presented = root.presentedViewController;
|
|
517
|
+
// if (presented != null) {
|
|
518
|
+
// return this.findTopViewController(presented);
|
|
519
|
+
// }
|
|
520
|
+
// if (root instanceof UISplitViewController) {
|
|
521
|
+
// const last = root.viewControllers.lastObject;
|
|
522
|
+
// if (last == null) {
|
|
523
|
+
// return root;
|
|
524
|
+
// }
|
|
525
|
+
// return this.findTopViewController(last);
|
|
526
|
+
// } else if (root instanceof UINavigationController) {
|
|
527
|
+
// const top = root.topViewController;
|
|
528
|
+
// if (top == null) {
|
|
529
|
+
// return root;
|
|
530
|
+
// }
|
|
531
|
+
// return this.findTopViewController(top);
|
|
532
|
+
// } else if (root instanceof UITabBarController) {
|
|
533
|
+
// const selected = root.selectedViewController;
|
|
534
|
+
// if (selected == null) {
|
|
535
|
+
// return root;
|
|
536
|
+
// }
|
|
537
|
+
// return this.findTopViewController(selected);
|
|
538
|
+
// } else {
|
|
539
|
+
// return root;
|
|
540
|
+
// }
|
|
541
|
+
// }
|
|
542
|
+
// }
|
|
356
543
|
//# sourceMappingURL=index.ios.js.map
|
package/video/index.ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/canvas-media/video/index.ios.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.ios.js","sourceRoot":"","sources":["../../../../packages/canvas-media/video/index.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,mBAAmB,EAAmD,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC7J,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCxD,MAAM,OAAO,KAAM,SAAQ,SAAS;IAQnC,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,MAAM,C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