66#import < CoreVideo/CoreVideo.h>
77#import < ImageIO/ImageIO.h>
88#import < React/RCTBlobManager.h>
9- #import < React/RCTBridge+Private.h>
109#import < ReactCommon/RCTTurboModule.h>
1110
1211#include " AppleVideoPlayer.h"
@@ -35,8 +34,10 @@ void checkIfUsingSimulatorWithAPIValidation() {
3534#endif
3635}
3736
38- ApplePlatformContext::ApplePlatformContext (ViewLookup viewLookup)
39- : _viewLookup(std::move(viewLookup)) {
37+ ApplePlatformContext::ApplePlatformContext (ViewLookup viewLookup,
38+ BlobManagerLookup blobManagerLookup)
39+ : _viewLookup(std::move(viewLookup)),
40+ _blobManagerLookup (std::move(blobManagerLookup)) {
4041 checkIfUsingSimulatorWithAPIValidation ();
4142}
4243
@@ -360,8 +361,7 @@ ImageData renderViewIntoPixels(const ResolvedSnapshot &snapshot,
360361
361362ImageData ApplePlatformContext::createImageBitmap (std::string blobId,
362363 double offset, double size) {
363- RCTBlobManager *blobManager =
364- [[RCTBridge currentBridge ] moduleForClass: RCTBlobManager.class ];
364+ RCTBlobManager *blobManager = (__bridge RCTBlobManager *)_blobManagerLookup ();
365365 NSData *blobData =
366366 [blobManager resolve: [NSString stringWithUTF8String: blobId.c_str ()]
367367 offset: (long )offset
@@ -378,9 +378,8 @@ ImageData renderViewIntoPixels(const ResolvedSnapshot &snapshot,
378378 std::string blobId, double offset, double size,
379379 std::function<void (ImageData)> onSuccess,
380380 std::function<void(std::string)> onError) {
381- // Resolve blob on current thread (requires RCTBridge access)
382- RCTBlobManager *blobManager =
383- [[RCTBridge currentBridge ] moduleForClass: RCTBlobManager.class ];
381+ // Resolve blob on current thread
382+ RCTBlobManager *blobManager = (__bridge RCTBlobManager *)_blobManagerLookup ();
384383 NSData *blobData =
385384 [blobManager resolve: [NSString stringWithUTF8String: blobId.c_str ()]
386385 offset: (long )offset
0 commit comments