Here’s how i have done it.
I have created the spline and then taken an array of n no. of vectors. Then I divide the length of the spline by n. and then I store world position of points along the spline into my array by the function World Position Of Point Along Spline At Distance. Then at each frame I subtract each vector from the array from the player’s position. The least result gives me the position on the spline closest to the player. Then I interpolate the position of the camera to the resultant point on the spline. It needs tweaking in terms of interpolation speed and the no. of points I take along the spline,but it works quite well. Another optimization could be to check only specific points from the array instead of the whole array depending on triggers along the level.