From reading some answers on this site (1, 2, 3 and 4) I found that, on time series data, standardization must be applied separately on the train and test sets to avoid data leakage.
So the train data would be standardized using a different mean than the test set. This makes sense as the mean of the train would be present in the test.
However, in the video Normalizing inputs at about 1:40 Prof. Andrew Ng mentions that the same mean and standard deviation should be used for both the train and test sets. Although the data was not a time series in the example it still contradicts the advice given on this site.
What is the main difference when standardizing time series and non-time series data? Why is there a difference?