1

My problem:

I work with Flutter and use the ARKit plugin.

The flutter arkit plugin is very extensive, but I can't find anything about how to display an AR video.

has this not yet been implemented in the ARKIT plugin? Plugin: https://pub.dev/packages/arkit_plugin

i already googled but i can't find anyone who has the same problem.

all the examples i can find are written in swift. Example: https://medium.com/quick-code/using-arkit-to-display-video-in-augmented-reality-3a2e4c1418ad

Does anyone have a solution for me?

Do I have to create a channel for the swift code?

Thanks for your help.

alexei
  • 11
  • 2

2 Answers2

0

add the video to folder ios/Runner

ARKitNode _createVideo() {
final _video = ARKitMaterialProperty.video(
  width: 406,
  height: 720,
  filename: 'myvideo.mp4',
);
final material = ARKitMaterial(
  diffuse: _video,
  doubleSided: true,
);

final plane = ARKitPlane(
  width: 1,
  height: 1,
  materials: [material],
);
return ARKitNode(
  geometry: plane,
  position: vector.Vector3(0, -.7, -.3),
  eulerAngles: vector.Vector3(360, 360, 360),
  name: 'my video',
);

}

user433575
  • 357
  • 1
  • 4
  • 13
0
 final   _video = ARKitMaterialProperty.video(
        url: 'https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4',
        width: 640,
        height: 320,
        autoplay: true,
        //  filename: 'london.mp4',
      );

      final material = ARKitMaterial(
        diffuse: _video,
        doubleSided: true,
      );

  final plane = ARKitPlane(
        width: 0.5,
        height: 0.3,
        materials: [material],
      );

      final earthPosition = anchor.transform.getColumn(3);
      final node = ARKitNode(
        geometry: plane,
        position: vector.Vector3(earthPosition.x, earthPosition.y, earthPosition.z),
        eulerAngles: vector.Vector3(0, 0,0),
      );


      arkitController.add(node);
user6757534
  • 201
  • 2
  • 3