YouTube Fade Away

In the last fuse day we created an android app which contains a YouTube view. The YouTube view was controlled remotely by a web server. You can see detailed description about the work in here.

The native YouTube view that we used, is the YouTubePlayerView . In order to be used, the following jar file should be an external library in the project.Google has great tutorial it is advised to read.

But what’s most interesting regarding the YouTubePlayerView is that it is a View. As a view the player should be placed in a layout. The fact that the player is a view enables us to apply animation on it. Animation can be applied at any phase on this View. This leads to better user experience. When component is not required it should fade out. When it is starting to play a video it should fade in. Events like pause should lead to small vibration to make the user notice the change.

For example we can decide to make it fade away, when the video ends playing:

@Override

public STATUS stop() {

    player.pause();

    AlphaAnimation alphaAnimation = new AlphaAnimation(1,0);

    alphaAnimation.setDuration(3000);

    alphaAnimation.setFillAfter(true);

    playerView.startAnimation(alphaAnimation);

    return STATUS.SUCCESS;

}

 
Thank you for your interest!

We will contact you as soon as possible.

Send us a message

Oops, something went wrong
Please try again or contact us by email at info@tikalk.com