Sorry for missing this part. I don't think use length to check this is a good idea. You should use `currentVideo.type.indexOf('/')` to get the correct position to slice.