nativescript-videoplayer: iOS app crashes when player loads in nativescript-vue NS7

The app crashes immediately after loading the page with the nativescript-videoplayer component.

To make sure it wasn’t a conflict with some other component, I created a new nativescript-vue project and added the following to the respective files:

app.js Vue.registerElement('VideoPlayer', () => require('nativescript-videoplayer').Video);

Home.vue

<template>
  <Page>
    <ActionBar>
      <Label text="Home" />
    </ActionBar>

    <StackLayout>
      <VideoPlayer
        src="https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/1080/Big_Buck_Bunny_1080_10s_1MB.mp4"
        height="300"
      />
    </StackLayout>
  </Page>
</template>

I ran the test app on the iPhone 8 emulator running iOS 14.

Running ns info:

Component nativescript has 7.0.8 version and is up to date.
Component @nativescript/core has 7.0.3 version and is up to date.
Component @nativescript/ios has 7.0.0 version and is up to date.

package.json dependencies:

  "dependencies": {
    "@nativescript/core": "~7.0.0",
    "@nativescript/theme": "~2.3.0",
    "nativescript-videoplayer": "^5.0.0",
    "nativescript-vue": "~2.8.0"
  },
  "devDependencies": {
    "@babel/core": "~7.1.0",
    "@babel/preset-env": "~7.1.0",
    "@nativescript/ios": "7.0.0",
    "@nativescript/webpack": "~3.0.0",
    "babel-loader": "~8.0.0",
    "nativescript-vue-template-compiler": "~2.8.0",
    "node-sass": "^4.7.1",
    "vue-loader": "~15.9.3"
  },

Download the project

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 15

Most upvoted comments

Thanks @bradmartin for the quick fix.

Thanks again @bradmartin. I also confirmed the update is working in my app on iOS 14.

I’m going to go ahead and publish as I believe the fix was the issue. Basically, when updating the plugin I forgot to add the webpack transformer to the iOS extends native class in the iOS source. So the source. code was not transpiled into ES5 which the runtimes need for native extended classes and it was transpiled into es2017 (per tsconfig settings) and as of now the runtimes do not support es2017 extending native classes which is what the NativeClass() decorator does in conjunction with ts-patch install running on the files prior to tsc. If either of you run into issues with other plugins, you can probably use this one and the blog post on updating plugins to see if you can spot maybe something the plugin author forgot to do 😄

Thanks @bradmartin. One estimate shows iOS 14 adoption above 25% already, so compatibility is increasingly critical.