Release directly referenced group bundle?

Hey all, I’ve been trying to figure out how Unity Addressables handles this situation:

I have some large video files that I play with the Unity video player.

I placed each video into their own respective remotely loaded group.

The videos are directly referenced using in the inspector of a prefab that contains the video player component, included in various scenes (which are also loaded using Addressables)

This all seems to work just fine, and Unity seems to load the respective videos Addressables bundle and play the video.

My question is: do I need to release the bundle when I am done with a video, somehow? (not sure how this would be done)

Or the memory used by the bundle and video are automatically released when the scene is unloaded and the video player instance is destroyed?

Thanks for your input in advance!

Addressables are released when they are no longer referenced. So generally if they are directly referenced they will be unloaded when the scene that references them are unloaded. That isn’t getting the full power of Addressables, however.

For finer grained memory management you can use an AssetReference and load them asynchronously with LoadAssetAsync. You would assign the video to the video player component at runtime. You would hold onto the load handle, and when you are done playing the video you could call release on it. This way you could bundle videos into their own asset bundle and unload them from memory when you’re done playing them rather than when the scene is unloaded.

I highly recommend reading the Addressables Best Practices blog post for ideas on how to best group your Assets.