Error creating an expo's Audio.Sound from blob - react-native

I have a backend that can delivers audio or image files (audio/x-m4a or image/jpeg) so I have to show them on my react-native/expo app. So I have something like this:
In line 19 I'm getting a blob from the backend and on line 21 and getting its URI.
So when I call this component for two images and one audio I get this:
blob:7E5FD45B-B10F-447B-B37C-D429DBA72871?offset=0&size=96665
blob:0A1BD6A2-C5B0-40C4-BB77-9A5F4A0E52B7?offset=0&size=281234
blob:6E7EB36F-FBC0-4F34-ADAC-864F0F5B75DF?offset=0&size=816812
I'm not sure how URI works on mobile but these URI are pretty weird for me...
Them in line 25 I'm trying to load an expo's Audio.Sound but I get this error:
[Unhandled promise rejection: Error: The AVPlayerItem instance has failed with the error code -1002 and domain "NSURLErrorDomain".]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:50 in promiseMethodWrapper
at node_modules/expo-modules-core/build/NativeModulesProxy.native.js:27:27 in moduleName.methodInfo.name
at http://192.168.1.33:19000/node_modules/expo/AppEntry.bundle?platform=ios&dev=true&hot=false&strict=false&minify=false:307121:50 in <unknown>
at node_modules/expo-av/build/Audio/Sound.js:136:34 in loadAsync
However I'm able to successfully show the image with line 38.
Any suggestion for the audio sound?

Related

Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 14

I am using the latest update of Drupal 9. For some reason when I install any NEW module that involves uploading images, It goes through the motions of uploading but does not save image. The images don't show up on the content from the module. And when I go back to look at it, the image is blank like I never uploaded an image. So I checked my error logs.
Here is the error in the log:
Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 14 of /home/xxxxxx/public_html/xxxxxxxx/core/lib/Drupal/Component/Serialization/PhpSerialize.php).
How do I fix this?
I tried asking drupal forums, No answer. I tried google. Nothing helped. I'm not that familiar with serialization.

How to use the SDK without the dependency on a main video

I am trying to put an ad without the need to put a video,
I tried to remove the video in the function and in the html view, but I get this error:
TypeError: Cannot read properties of undefined (reading 'init')
Code
adsManager.init(640, 360, google.ima.ViewMode.NORMAL);

Malformed calls from JS : field sizes are different

I've gone through link : https://github.com/facebook/react-native/issues/23835#issuecomment-493007479
But got no solution. I got the understanding that this bug is triggered when
You send NaN in array on react native bridge. I don't know much about it.
During use of invalid data (infinity) in animation.
During bottom navigation.
Using menu.
Showing response data in Alert or Notifications as Toasts.
I am using react-native-ble-manager.
Procedure: I sent write message using characteristic that allows write, after setting notifications on for characteristic that allows read. I got 'ack' in the response listener that was used to receive notifications, and then I start sending custom data chunks by chunks as designed.
I get this error during this first chunk was being sent.
I've checked my uint8Array for any wrong data using iteration and to, but couldn't found any.
From my logs:
2020-09-04 12:52:13.944 21942-22004/com.my_app E/ReactNativeJS: Error: Exception in HostFunction: Malformed calls from JS: field sizes are different.
[[3,13,37],[5,22,0],[["{\"type\":\"log\",\"level\":\"log\",\"data\":[\"payload[18]: \\u0000\"]}",1],[221,100,1599204133919,false]],2453]
I iterated through my uint8Array and took each of the elements in
var newArr = [];
I also did newArr[i] = newArr[i] & 0xff.
The error was gone.

vjs_pause function does not exists in swf mode

With video.js 4.0.3, I got this error when using the flash mode :
Uncaught exception: TypeError: 'this.el_.vjs_pause' is not a function
Error thrown at line 2772
No problem with HTML5 mode.
The pause function seems to be unavailable in the flash object
I ran into this same JS error few days back. The fix that worked for me was to first check if the video element or it's parent is visible or not. Only when it's visible, trigger the pause method.
Hope this helps!

MediaElement Uncaught TypeError: Cannot read property 'tagName' of null

I would like to use MediaElement to serve all the videos/formats we have without creating different players. My first attempt was with an .mwv file with throws the error listed in the Title of this post. Next I tried an MP4 which seems to work fine. Then I tried an .flv file which also threw the same error listed in the title.
In Chrome I see "Uncaught TypeError: Cannot read property 'tagName' of null" the console which occurs in mediaelement-and-player.min.js at line 40 but the viewer part of the player doesn't display at all. In Firefox I see "TypeError: d is null" in the console at the same line number but the viewer part of the player DOES display and it says: "Video format or MIME type is not supported". The MediaElement documentation indicates that those types are supported but I can't seem to get them to play.
Either I mis-configured the player or I am passing the wrong content-type (I tried several) or this is a bug. I saw a similar post but the solution posted there was a little vague. I am going to try different files, formats and mime types to see if I can sort out the issue but I think this is a code problem. Ha anyone else been able to play flv or wmv files with mediaElement? Was there a trick to making it work?
I missed a step (or a directive) in the configuration. The 'tagName' error had to do with the content type I was using and was not defined in Glassfish. The reason that nothing was playing was that I forgot to list the class as "mejs-player" in the video tag.
Cleaning up those two things got the player working.