TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.2k stars 2.9k forks source link

Crashed iOS setSrc after rendering and unmounting 7 remote url videos #1650

Closed aldrinc closed 5 years ago

aldrinc commented 5 years ago

Bug

I am using react-native-snap-carousel to generate a video feed for a user. Upon application load, I load up 3 "slides" and only mount the video component when the user lands on the slide. Once the user swipes off the video the video is unmounted. This works well until around 7 -9 videos in when the application suddenly crashes. The stack trace shows the RCTVideo setSrc method dispatch action causing the crash.

EDIT: I've isolated the crash to this issue and my understanding is that the application is requesting to load a video multiple times and that the initial request has not been complete before the next request is requested.

https://stackoverflow.com/questions/16073519/nsurlerrordomain-error-code-999-in-ios

As you can see; -999 is caused by ErrorCancelled. This means: another request is made before the previous request is completed.

Also when I go breakpoint by breakpoint in Xcode I land here:

NSURL *url = isNetwork || isAsset
    ? [NSURL URLWithString:uri]
    : [[NSURL alloc] initFileURLWithPath:[[NSBundle mainBundle] pathForResource:uri ofType:type]];
  NSMutableDictionary *assetOptions = [[NSMutableDictionary alloc] init];

Additional output even when some videos load.

 load failed with error Error Domain=NSURLErrorDomain Code=-999 "cancelled" UserInfo={NSErrorFailingURLStringKey=https://thingd-media-ec1.thefancy.com/video/upload/FancyMerchant/saleitem/5144112/20180111175926/walabot.mp4, NSErrorFailingURLKey=https://thingd-media-ec1.thefancy.com/video/upload/FancyMerchant/saleitem/5144112/20180111175926/walabot.mp4, _NSURLErrorRelatedURLSessionTaskErrorKey=(
    "LocalDataTask <3163FEBD-AB16-442F-A59C-5488DB0B90F5>.<7>"
2019-07-05 13:48:47.105055-0500 AwesomeProject[47205:613908] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010568a6fb __exceptionPreprocess + 331
    1   libobjc.A.dylib                     0x0000000103841ac5 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010568a555 +[NSException raise:format:] + 197
    3   Foundation                          0x0000000103348cf3 -[NSURL(NSURL) initFileURLWithPath:] + 127
    4   AwesomeProject                      0x0000000101720681 -[RCTVideo playerItemForSource:withCallback:] + 881
    5   AwesomeProject                      0x000000010171ea52 __19-[RCTVideo setSrc:]_block_invoke + 178
    6   libdispatch.dylib                   0x0000000107695d7f _dispatch_call_block_and_release + 12
    7   libdispatch.dylib                   0x0000000107696db5 _dispatch_client_callout + 8
    8   libdispatch.dylib                   0x00000001076a4080 _dispatch_main_queue_callback_4CF + 1540
    9   CoreFoundation                      0x00000001055f18a9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
    10  CoreFoundation                      0x00000001055ebf56 __CFRunLoopRun + 2310
    11  CoreFoundation                      0x00000001055eb302 CFRunLoopRunSpecific + 626
    12  GraphicsServices                    0x000000010958f2fe GSEventRunModal + 65
    13  UIKitCore                           0x0000000110030ba2 UIApplicationMain + 140
    14  AwesomeProject                      0x000000010143bef0 main + 112
    15  libdyld.dylib                       0x000000010770b541 start + 1
    16  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

code -999

Environment info

React native info output:

 React Native Environment Info:
    System:
      OS: macOS 10.14.5
      CPU: (8) x64 Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
      Memory: 643.52 MB / 16.00 GB
      Shell: 5.3 - /bin/zsh
    Binaries:
      Node: 12.4.0 - /usr/local/bin/node
      Yarn: 1.17.0 - /usr/local/bin/yarn
      npm: 6.9.0 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.2, macOS 10.14, tvOS 12.2, watchOS 5.2
      Android SDK:
        API Levels: 23, 25, 28
        Build Tools: 23.0.1, 25.0.0, 28.0.3
        System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
    IDEs:
      Android Studio: 3.3 AI-182.5107.16.33.5314842
      Xcode: 10.2/10E125 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.8.3 => 16.8.3 
      react-native: ^0.59.9 => 0.59.9 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Library version: "react-native-video": "^4.4.2",

Steps To Reproduce

Sample code available below.

  1. Install react-native-snap-carousel
  2. Create view that covers the full width/height of device
  3. Install react-native-video and create a video component
  4. Hardcode the below sample data for testing.
  5. Loop over the sample data and render slides with a video component
  6. Open and start application through Xcode
  7. Swipe through 7-9 slides and see a crash in Xcode

SAMPLE DATA

[  {
    name: 'Panda Cat Thief Coin Bank',
    short_description: 'The Bank Panda follows its predecessors in hiding in the box, to reach ' +
      'up and grab your coin when placed on the bamboo-decorated bowl in front.',
    woocommerce_id: 7907,
    original_url: 'https://shopjustlook.com/product/panda-cat-thief-coin-bank/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Panda-Cat-Thief-Money-boxes-toy-piggy-banks-gift-kids-money-boxes-Automatic-Stole-Coin-Piggy.jpg',
    video_url: 'https://thingd-media-ec3.thefancy.com/video/upload/VEASOON/saleitem/7571222/20181220160935/pandaz.mp4',
    id: 5d00c67922f9e67a5be00395
  },
  {
    name: 'DJI Osmo Pocket 3-Axis Stabilized Camera',
    short_description: '<div class="thumbnail-list"></div>\r' +
      '<div class="description">\r' +
      '<div class="detail">\r' +
      '<div>\r' +
      '<div>\r' +
      '<div>As the smallest 3-axis stabilized handheld camera DJI ' +
      'has ever designed, the compact and intelligent Osmo Pocket ' +
      'turns any moment into a cinematic memory.</div>\r' +
      '</div>\r' +
      '</div>\r' +
      '</div>\r' +
      '</div>',
    woocommerce_id: 7891,
    original_url: 'https://shopjustlook.com/product/dji-osmo-pocket-3-axis-stabilized-camera/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/DJI-Osmo-Pocket-3-axis-stabilized-handheld-camera-4K-60fps-Video-DJI-compact-and-intelligent.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/FancyMerchant/saleitem/7739772/20181205163410/djiz.mp4',
    id: 5d00c67922f9e67a5be00396
  },
  {
    name: 'Color Smart LED Speaker Bulb',
    short_description: 'Just by replacing a light bulb, you will ' +
      'make much difference to your living space.',
    woocommerce_id: 7880,
    original_url: 'https://shopjustlook.com/product/color-smart-led-speaker-bulb/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Smart-RGB-Bulb-Bluetooth-4-0-Audio-Speakers-Lamp-Dimmable-E27-LED-Wireless-Music-Bulb-Light.jpg',
    video_url: 'https://thingd-media-ec1.thefancy.com/video/upload/FancyMerchant/saleitem/3247172/20170427131555/bulb.mp4',
    id: 5d00c67922f9e67a5be00397
  },
  {
    name: 'OFF/ON Nightlight',
    short_description: 'Switch model: Gravity Sensor��ON / OFF',
    woocommerce_id: 7871,
    original_url: 'https://shopjustlook.com/product/off-on-nightlight/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Creative-Muid-on-off-Touch-Switch-Lamp-USB-Charging-LED-adjustable-brightness-Night-Light-Gravity-Sensor.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/infpass/saleitem/1420724/20190412231349/onoff.mp4',
    id: 5d00c67922f9e67a5be00398
  },
  {
    name: 'Sphero Mini App-Controlled Robot Ball',
    short_description: 'Sphero Mini fits a huge experience into a ' +
      'tiny robot the size of a ping pong ball.',
    woocommerce_id: 7857,
    original_url: 'https://shopjustlook.com/product/sphero-mini-app-controlled-robot-ball/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Sphero-Mini-Smart-ball-robotic-ball-Drive-play-games-learn-to-code-and-more.png',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/FancyMerchant/saleitem/4514046/20170929162413/adfajkdhf.mp4',
    id: 5d00c67922f9e67a5be00399
  },
  {
    name: 'Classic Macintosh Apple Watch Charger Holder',
    short_description: 'Funny�� and convenient stand holder with a comfortable viewing angel.',
    woocommerce_id: 7845,
    original_url: 'https://shopjustlook.com/product/classic-macintosh-apple-watch-charger-holder/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Retro-MAC-Retro-Classic-Silicone-Charging-Stand-Base-38-42mm-for-Apple-Watch-1-2-3.jpg',
    video_url: 'https://thingd-media-ec4.thefancy.com/video/upload/VEASOON/saleitem/4563334/20190404183135/elagoz.mp4',
    id: 5d00c67922f9e67a5be0039a
  },
  {
    name: 'Pacman Ghost Light',
    short_description: 'This PAC-MAN Ghost Light is a colour changing ' +
      'mood light with two different modes to choose ' +
      'from.',
    woocommerce_id: 7834,
    original_url: 'https://shopjustlook.com/product/pacman-ghost-light/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/PacMan-Ghost-Light-LED-Night-Light-Multicolor-Cartoon-Night-Lamps-USB-Rechargeable-For-Children-Kids-Room.jpg',
    video_url: 'https://thingd-media-ec6.thefancy.com/video/upload/VEASOON/saleitem/4034985/20180913213558/pacmanz.mp4',
    id: 5d00c67922f9e67a5be0039b
  },
  {
    name: 'Pulse 3 Lightshow Bluetooth Speaker',
    short_description: '<div class="thumbnail-list"></div>\r' +
      '<div class="description">\r' +
      '<div class="detail">\r' +
      '<h4 class="tit">Take your listening experience to the next level with ' +
      'the JBL Pulse 3, the portable, waterproof Bluetooth speaker that ' +
      'combines 360�� sound with 360�� lightshow.</h4>\r' +
      '</div>\r' +
      '</div>',
    woocommerce_id: 7823,
    original_url: 'https://shopjustlook.com/product/pulse-3-lightshow-bluetooth-speaker/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/JBL-Pulse3-Portable-Bluetooth-Lightshow-Music-Speaker-Colorful-Voice-Assistant-Stereo-Speaker-IPX7-Waterproof-With-Speakerphone.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/FancyMerchant/saleitem/4152999/20170808121805/ip.mp4',
    id: 5d00c67922f9e67a5be0039c
  },
  {
    name: 'Puff-N-Fluff Dog Dryer',
    short_description: 'The Puff-N-Fluff dog dryer is made by using a rectangle ' +
      'piece of material with four elastic leg holes. The paws are ' +
      'placed through the openings, and then the sides are brought ' +
      'together and easily fastened by a hook &amp; loop. Next, ' +
      'pull the draw strings to close the gap around the head and ' +
      'tail.',
    woocommerce_id: 7810,
    original_url: 'https://shopjustlook.com/product/puff-n-fluff-dog-dryer/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/2018-NEW-Hot-Dog-Dryer-Makes-Dog-Drying-Fast-and-Easy-After-A-Bath-S.jpg',
    video_url: 'https://thingd-media-ec1.thefancy.com/video/upload/FancyMerchant/saleitem/923611/20181107034608/dryzzzz.mp4',
    id: 5d00c67922f9e67a5be0039d
  },
  {
    name: 'LED Eyelashes',
    short_description: 'Lightweight, LED lashes that immediately respond to head and body ' +
      'movement such as dancing, jumping around, or posing for selfies.',
    woocommerce_id: 7799,
    original_url: 'https://shopjustlook.com/product/led-eyelashes/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Glowing-Eyes-Sticker-Women-Flashes-LED-False-Eyelashes-Luminous-Electronic-Waterproof-Fake-Eyelashes-Halloween-Props-Drop.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/FancyMerchant/saleitem/5345307/20180214161611/lash.mp4',
    id: 5d00c67922f9e67a5be0039e
  },
  {
    name: 'Portable Pet Water Bottle',
    short_description: 'Large and insulated, this water bottle will hold enough for ' +
      'your dog to drink on long trips and keep it cool all day, ' +
      'too!',
    woocommerce_id: 7773,
    original_url: 'https://shopjustlook.com/product/portable-pet-water-bottle/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Portable-Pet-Dog-Water-Bottle-For-Small-Large-Dogs-Travel-Puppy-Cat-Drinking-Bowl-Outdoor-Pet.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/GoodBoyShop/saleitem/8154190/20190211202825/PremiumPortablePetsWaterBottle-1.mp4',
    id: 5d00c67922f9e67a5be0039f
  },
  {
    name: 'Ninebot GoKart Kit',
    short_description: 'Transform your Segway miniPRO into a ' +
      "'Formula One Style' Drive-able " +
      'Go-kart!',
    woocommerce_id: 7759,
    original_url: 'https://shopjustlook.com/product/ninebot-gokart-kit/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Original-Ninebot-Gokart-Kit-Refit-Smart-Self-Balancing-Electric-Scooter-Xiaomi-Mini-Ninebot-by-Segway-Mini.jpg',
    video_url: 'https://thingd-media-ec6.thefancy.com/video/upload/FancyMerchant/saleitem/7731226/20181204141136/seqz.mp4',
    id: 5d00c67922f9e67a5be003a0
  },
  {
    name: 'MasterPan Non-Stick 3 Section Meal Skillet',
    short_description: 'Why use multiples pans to make a great meal when you ' +
      'only need one? Cook up to 3 different foods all at ' +
      'once on one burner with this 3-in-1 Non-Stick ' +
      'Skillet!',
    woocommerce_id: 7750,
    original_url: 'https://shopjustlook.com/product/masterpan-non-stick-3-section-meal-skillet/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Three-In-One-Multi-Purpose-Separation-Pot-Fryer-Pan-Breakfast-Non-Stick-Grill-Fry-Oven-Meal.jpg',
    video_url: 'https://thingd-media-ec3.thefancy.com/video/upload/masterpan/saleitem/2267184/20190408233111/materzzz.mp4',
    id: 5d00c67922f9e67a5be003a1
  },
  {
    name: 'Raclette Demi Cheese Melter',
    short_description: 'This unique cheese raclette heats the top of the cheese ' +
      'through a heat lamp, keeping the bottom of the cheese firm ' +
      'while you easily scrape off the molten cheese from the ' +
      'top.',
    woocommerce_id: 7743,
    original_url: 'https://shopjustlook.com/product/raclette-demi-cheese-melter/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Popular-cheese-raclette-cheese-melter.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/FancyMerchant/saleitem/4937566/20171205180526/raclette.mp4',
    id: 5d00c67922f9e67a5be003a2
  },
  {
    name: 'Cap Gun Bottle Opener',
    short_description: 'Pop the cap, aim, fire, then just sit back and enjoy your tasty beverage',
    woocommerce_id: 7734,
    original_url: 'https://shopjustlook.com/product/cap-gun-bottle-opener/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/NEW-Firing-Cap-Gun-Creative-Flying-Cap-Launcher-Bottle-Beer-Opener.jpg',
    video_url: 'ttps://thingd-media-ec5.thefancy.com/video/upload/VEASOON/saleitem/8296324/20190305182744/gunz.mp4',
    id: 5d00c67922f9e67a5be003a3
  },
  {
    name: 'Bottle Light LED Cork',
    short_description: 'Shaped like a cork with a super bright LED that ' +
      'recharges via USB. Make interesting lights with ' +
      'vintage drinks bottles or create a cosy, improvised ' +
      'table feature.',
    woocommerce_id: 7723,
    original_url: 'https://shopjustlook.com/product/bottle-light-led-cork/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/YB-Yiba-LED-Wine-Bottle-Night-light-Magic-Cork-Shaped-USB-Rechargeable-cork-stopper-cap-lamp.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/LOVEThESIGN/saleitem/1522257/20180914211055/lightz.mp4',
    id: 5d00c67922f9e67a5be003a4
  },
  {
    name: 'Chemion LED Bluetooth Glasses',
    short_description: 'Fun &amp; unique way to show your bright ' +
      'creativity and stand out in any crowd!',
    woocommerce_id: 7715,
    original_url: 'https://shopjustlook.com/product/chemion-led-bluetooth-glasses/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/CHEMION-Bluetooth-LED-Glasses-Special-Atmosphere-Sunglasses-Dynamic-Glowing-Light-for-Nightclub-Festival-Party-Birthday.jpg',
    video_url: 'https://thingd-media-ec4.thefancy.com/video/upload/FancyMerchant/saleitem/7477112/20181016120838/chemionz.mp4',
    id: 5d00c67922f9e67a5be003a5
  },
  {
    name: 'Roller Coaster Building Block Bricks',
    short_description: 'Capture the speed, thrills and excitement of the ultimate fairground ' +
      'attraction with this incredible Building block bricks Roller Coaster.',
    woocommerce_id: 7707,
    original_url: 'https://shopjustlook.com/product/roller-coaster-building-block-bricks/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/New-4619Pcs-The-roller-coaster-fit-legoings-city-creator-technic-figures-Buidling-Block-Bricks-10261-Kids.jpg',
    video_url: 'https://thingd-media-ec3.thefancy.com/video/upload/FancyMerchant/saleitem/5891590/20180509193448/legoz.mp4',
    id: 5d00c67922f9e67a5be003a6
  },
  {
    name: 'Star Wars R2-D2 Coffee Press',
    short_description: 'Carafe is dishwasher safe, not microwave safe. It ' +
      'includes glass carafe, plunger &amp; filter, and ' +
      'housing',
    woocommerce_id: 7700,
    original_url: 'https://shopjustlook.com/product/star-wars-r2-d2-coffee-press/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/960ml-Home-Mini-Star-Wars-R2-D2-Manual-Coffee-Maker-French-Pressed-Coffee-Pot.jpg',
    video_url: 'https://thingd-media-ec1.thefancy.com/video/upload/FancyMerchant/saleitem/5255973/20180130163715/r2d2.mp4',
    id: 5d00c67922f9e67a5be003a7
  },
  {
    name: 'Electric Spice Pen',
    short_description: 'This Spice Pen allows you to make creative messages and drawings ' +
      'with all-natural materials found in food, such as ground ' +
      'cinnamon, paprika, parsley, instant cocoa powder, ground sugar ' +
      'and more.',
    woocommerce_id: 7693,
    original_url: 'https://shopjustlook.com/product/electric-spice-pen/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Electric-Spice-Pen-for-Latte-and-Food-Art-DIY-Special-Floral-Pattern-with-Cinnamon-Coffee-Grounds.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/LoveBoutiques/saleitem/7683632/20190315034400/cofzzz.mp4',
    id: 5d00c67922f9e67a5be003a8
  },
  {
    name: 'Whiteshark Mix Underwater Scooter',
    short_description: 'Glide through the water with the WhiteShark Mix Underwater Scooter.',
    woocommerce_id: 7682,
    original_url: 'https://shopjustlook.com/product/whiteshark-mix-underwater-scooter/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Sublue-Whiteshark-Mix-Underwater-Scooter-for-Swimming-Diving-Snorkeling-in-the-Water.jpg',
    video_url: 'https://thingd-media-ec3.thefancy.com/video/upload/FancyMerchant/saleitem/7156155/20180823183744/skilzzz.mp4',
    id: 5d00c67922f9e67a5be003a9
  },
  {
    name: 'Drone Parachutes',
    short_description: 'This parachute is made of high-quality nylon umbrella cloth, ' +
      'which has been repeatedly tested by the dream-seeking model.',
    woocommerce_id: 7666,
    original_url: 'https://shopjustlook.com/product/drone-parachutes/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/4-6-8-12KG-Parachute-Ejection-Umbrella-Ejection-Chute-For-FPV-RC-Airplane-Drone-Fixed-Wing.jpg',
    video_url: 'https://thingd-media-ec6.thefancy.com/video/upload/FancyMerchant/saleitem/3313064/20170504150156/para.mp4',
    id: 5d00c67922f9e67a5be003aa
  },
  {
    name: 'Luxury Family Tent',
    short_description: 'The zip is protected and concealed by a canvas storm flap ' +
      'that runs its length to ensure zero penetration of water.',
    woocommerce_id: 7654,
    original_url: 'https://shopjustlook.com/product/luxury-family-tent/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/DANCHEL-Cotton-Canvas-Bell-Tent-light-khaki-Waterproof-Tipi-Luxuty-Family-Party-Tent-with-Stove-Jacket.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/FancyMerchant/saleitem/7457235/20181011233753/tentz.mp4',
    id: 5d00c67922f9e67a5be003ab
  },
  {
    name: 'Justice League Movie Elite-Tek Batmobile RC Vehicle',
    short_description: 'Deluxe, remote controlled Batmobile ' +
      'with premium Justice League movie ' +
      'features',
    woocommerce_id: 7646,
    original_url: 'https://shopjustlook.com/product/justice-league-movie-elite-tek-batmobile-rc-vehicle/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/1-18-Batman-vs-Superman-Justice-League-electric-RC-car-kids-toy-model-Gift-simulation-display.jpg',
    video_url: 'https://thingd-media-ec6.thefancy.com/video/upload/FancyMerchant/saleitem/4706214/20171027202338/balgjaklfgjdwajdsflk.mp4',
    id: 5d00c67922f9e67a5be003ac
  },
  {
    name: '360 LED Visibility Vest',
    short_description: 'The visibility vest uses the full-color spectrum in ' +
      'specially designed illumination modes to keep you highly ' +
      'visible.',
    woocommerce_id: 7630,
    original_url: 'https://shopjustlook.com/product/360-led-visibility-vest/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/360-Reflective-LED-Flash-Driving-Vest-High-Visibility-Night-Running-Cycling-Riding-Outdoor-Activities-Light-Up.jpg',
    video_url: 'https://thingd-media-ec3.thefancy.com/video/upload/FancyMerchant/saleitem/901037/20160914010146/doneski.mp4',
    id: 5d00c67922f9e67a5be003ad
  },
  {
    name: 'Kitty Tail Car Decal',
    short_description: 'The Moving Tail Kitty Car Decal is ' +
      'designed for cars with a rear window ' +
      'wiper.',
    woocommerce_id: 7623,
    original_url: 'https://shopjustlook.com/product/kitty-tail-car-decal/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Reflective-Car-Stickers-Cartoon-Funny-Moving-Tail-Cat-Stickers-Dynamic-Sticker-Rear-Window-Wiper-Stickers-Waterproof.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/LoveBoutiques/saleitem/4298557/20190313155730/catz.mp4',
    id: 5d00c67922f9e67a5be003ae
  },
  {
    name: 'Samsung Gear VR',
    short_description: 'Samsung Gear VR transforms virtual reality with a ' +
      'new handheld controller that seamlessly responds ' +
      'to organic, human movements in virtual ' +
      'experiences.',
    woocommerce_id: 7608,
    original_url: 'https://shopjustlook.com/product/samsung-gear-vr/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Gear-VR-4-0-3D-Glasses-Gyro-Sensor-Virtual-Reality-Helmet-Built-For-Samsung-Galaxy-Note.jpg',
    video_url: 'https://thingd-media-ec5.thefancy.com/video/upload/FancyMerchant/saleitem/3247514/20170427134337/vr.mp4',
    id: 5d00c67922f9e67a5be003af
  },
  {
    name: 'Jimu Robot Kits',
    short_description: 'Jimu Robot Kits are the buildable, programmable robot kits.',
    woocommerce_id: 7593,
    original_url: 'https://shopjustlook.com/product/jimu-robot-kits/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/Hotly-DIY-Electric-UBTECH-Jimu-3D-Programmable-Creativity-DIY-Robot-Kit-For-Puzzle-Assemble-Robot-Educational.jpg',
    video_url: 'https://thingd-media-ec2.thefancy.com/video/upload/FancyMerchant/saleitem/2962603/20170327161102/yo.mp4',
    id: 5d00c67922f9e67a5be003b0
  }]

...

Describe what you expected to happen:

  1. The application should unmount or remove unused video components

Reproducible sample code

https://github.com/aldrinc/react-native-video-example

CHaNGeTe commented 5 years ago

Any of the files on the playlist is local? I see

2019-07-05 13:48:47.105055-0500 AwesomeProject[47205:613908] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'

initFileURLWithPath is called for not network files (when IsNetwork is false, and isAsset is false also)

const isNetwork = !!(uri && uri.match(/^https?:/));
const isAsset = !!(uri && uri.match(/^(assets-library|ipod-library|file|content|ms-appx|ms-appdata):/));

So seems we have the guilty one:

{
    name: 'Cap Gun Bottle Opener',
    short_description: 'Pop the cap, aim, fire, then just sit back and enjoy your tasty beverage',
    woocommerce_id: 7734,
    original_url: 'https://shopjustlook.com/product/cap-gun-bottle-opener/',
    image_url: 'https://shopjustlook.com/wp-content/uploads/2019/05/NEW-Firing-Cap-Gun-Creative-Flying-Cap-Launcher-Bottle-Beer-Opener.jpg',
    video_url: 'ttps://thingd-media-ec5.thefancy.com/video/upload/VEASOON/saleitem/8296324/20190305182744/gunz.mp4',
    id: 5d00c67922f9e67a5be003a3
  },

notice the video_url

CHaNGeTe commented 5 years ago

To find errors like this you can filter the playlist to see possible issues: Assuming data is the playlist

data.filter((s) => {
const uri = s.video_url;
return !(!!(uri && uri.match(/^https?:/)))
})

If the filter returns and array with length, sth is wrong with that assets.