0

In a NativeScript application, I'm trying to apply a real-time effect to an applied video (specifically, grayscale video playback). I am currently playing the video in app using a fork of the nativescript-videoplayer nativescript plugin. The relevant source code that creates the video view in android is here:

https://github.com/nstudio/nativescript-videoplayer/blob/master/src/videoplayer.android.ts

In essence, I want to modify it to apply an effect / shader, similar to the answer given here:

https://stackoverflow.com/a/31958741/192694

However, I'm not sure where this shader code would hook up to my existing stream of MediaPlayer creation and setting its SurfaceTexture surface.

G. Ciardini
  • 1,210
  • 1
  • 17
  • 32
Bill Dami
  • 3,205
  • 5
  • 51
  • 70
  • 1
    This is probably going to help I hope: https://stackoverflow.com/questions/31805837/applying-effects-on-video-being-played?noredirect=1&lq=1 – Treewallie Oct 02 '19 at 15:52
  • 1
    @Treewallie thanks, yeah that is the SO question I linked to in my original post here, and I _think_ that is what I want.. however from the answer I can not determine how that would fit into my NativeScript app code. – Bill Dami Oct 02 '19 at 17:14

1 Answers1

2

The original video player plugin uses a TextureView on MediaPlayer instance, instead you may use the GLSurfaceView as showcased in the other SO example @Bill linked.

Manoj
  • 21,753
  • 3
  • 20
  • 41