Also, I just wanted to point out that a global YoutubePlayer object doesn't work very well when switching between layouts. For example, the initial layout with this object contains 3 layers, and the video is on the top layer. Then I switch to a layout with just one layer. If I come back to the initial layout after that, the video object switches to the first, bottom layer. And there is no action "Move to layer" for the object. I had to create 2 more layers on the level I switch to, just for this.