I'm curious to know if I can program the videos that can be played on computer in general and on Youtube as a special case.
I had this crazy idea and I was able to create a very simple toss the coin game (without programming) on youtube: https://youtu.be/fkYYF5w5vpE
I think programming a video would create more complex games and has some other nice applications like choosing whether or not to watch the movie uncut, turn on and off 3D feature, creating videos for visually impaired people, ..etc.
On Youtube, I think it would be dangerous as in the past, hackers wrote programming lines (viruses) in a jpg or gif file extensions and uploaded it to the servers of the websites. So, If videos can be programmed on computers. Is it possible to upload them safely?
Edit:
I would like to write some codes inside a video so that it randomly chooses between two frames (Head or Tail). When someone plays the video, the head will appear. When he pauses and plays again, the Tail appears. Just like the linked video but the one that I would like to make should somehow contain programming code inside it.
ffmpeg
and YouTube has an api for uploading but that is not what you are asking.