Yes; as done in the lecture you have linked, this is shown using amortized analysis. The intuition is that even though resizing take $O(m)$ (where $m$ is the size of the table at the time of resizing), this operation occurs more infrequently the more times we have already resized.
Even if $n$ is not known in advance, as is the case in most practical applications of hashtables, the same amortized analysis holds. This is a simple result of the fact that in the analysis, the cost of the resize operation is divided among all insertions which occurred before the resizing operation. Hence, every time we resize the table, we have already achieved our $O(1)$ average runtime by the analysis provided. Any additional insertions we perform before the next resize will of course each be done in $O(1)$ time, so on average, each of the $n$ insertions takes $O(1)$ time.