Video Player Start Play

Hi @kipash :cactus: … cheeeeeeeeeeers for the input. I’ll check out all you’ve suggested :+1:

by user 908977119781060648

Nope… sadly, nothing seems to get the video to start playing from its beginning.

I seem to be down several rabbit holes now, so I think I’ll have to leave it for a while and clear my head… just for now anyway :slightly_smiling_face:

Thanks for all the help, both of you :smiling_face_with_three_hearts:

by user 908977119781060648

mmmh I just tried the same thing with this snippet of code (just added it to the main.ts)

import { AudioSource, GameObject, VideoPlayer, onStart } from "@needle-tools/engine";

onStart(() => {
    var video = GameObject.findObjectOfType(VideoPlayer);
    AudioSource.registerWaitForAllowAudio(() => {
        video?.play();
    });
})

that works for me here. If it still doesnt work for you could you send your scene as a bugreport?
20231123-175621_Fdsfd_-_Google_Chrome-logo.mp4

Cheeeeeeeeers Marcel, I’ll take a look asap :sunglasses: :+1:

by user 908977119781060648

Hi again Marcel… apols but I think I’m probably adding your snippet to the wrong part of the script that I’m using.

If possible, when you have a spare moment could you show me where how you would add it to this? (play.ts - attached)

Many thanks, in advance :slightly_smiling_face:
play.ts

by user 908977119781060648

Hi Frannie, so you can do this without writing code too btw:

  • leave your Timeline on PlayOnAwake
  • disable the VideoPlayer in your scene,
  • add an animationclip in the timeline with one keyframe to just enable the videoplayer
  • add your audio to the timeline

20231124-090611_Needle_Engine_2021_URP_-fdsfd-_Windows_Mac_Lin-logo.mp4

20231124-090644_Fdsfd_-_Google_Chrome.mp4

You could also put your videoplayer on an extra gameobject and use activation tracks :slightly_smiling_face:

Cheers once again, Marcel… I’ll have a look at giving those recommendations a try right now :slightly_smiling_face:

Will feedback here asap…

by user 908977119781060648

Apols for lack of feedback re: this.

I’m still endeavouring to get it running at this end but have had to divert attention to other work just for now :slightly_smiling_face:

Back on it again soon!

by user 908977119781060648

YESSSSSSSSSSS!!!

Got it all working perfectly using a combination of the solutions you both so kindly suggested.

Happy days! :smiling_face_with_three_hearts: :rocket: :partying_face: :raised_hands:

Cheeeeeeeeeeeeeeeers, Marcel & Kipash, for your time and expertise! It’s always hugely appreciated!

by user 908977119781060648

Anytime :slight_smile: