Is there a way to make the NPC “show” you a video on a media player on user request?
E.G:
“Can you show me a video of the last show?”
“Sure”
Media player pops up with the video
Keep in mind that the NPC will stand still and never moves.
Is there a way to make the NPC “show” you a video on a media player on user request?
E.G:
“Can you show me a video of the last show?”
“Sure”
Media player pops up with the video
Keep in mind that the NPC will stand still and never moves.
Thanks! But is there a way to know what video to play based on user request?
This depends on how you’ve implemented your PlayVideo action. You’ll need to determine which video to play based on your implementation.
Alternatively, you can use our Narrative Design feature. You can configure sections corresponding to each video, and based on the user input, the relevant section will be triggered,where you can initiate the video accordingly.
Thanks! I actually solved this issue with the narrative design and some scripting (by detecting with API calls when the NPC replied in specific ways). Thanks for your help!
@Luca_Trianti Awesome!
@Luca_Trianti Do you want to share your solution so that other users can use it too?
@Luca_Trianti Is it possible for you to share your solution with the community on how you managed to do the action for video player?
So, there are two main classes: one being the “media handler” and the other one being the “api handler”.
Info:
videoList.txt file (containing the video file names, and I know, it’s not very dynamic).videoList.txt in StreamingAssets/Videos, making it easy to update the list without recompiling.Application.persistentDataPath before playing it, which is especially needed on Android where direct access to StreamingAssets isn’t possible.Here are the links to the 2 classes:
The ConvaiAPIHandler is attached to an empty game object, while the ConvaiMediaHandler is attached directly to the canvas of the video player.
If you have any questions please ask.