Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
Y

YouTubePlayerActivity

> 编程语言
Open source

Android Youtube Player Activity. Simply pass a url to play youtube video in new activity. It supports screen orientation, media volume control and etc.

389 stars0 likes1 views
WebsiteGitHub

About

Android Youtube Player Activity. Simply pass a url to play youtube video in new activity. It supports screen orientation, media volume control and etc.

YouTube Player Activity

Simply pass an url to play youtube video in new activity. It supports screen orientation, media volume control and etc.

Preview

Sample Demo

You can download demo movie file here : demo.mov

It's also on Youtube:

Sample Project

You can download the latest sample APK from this repo here: sample-release.apk

It's also on Google Play:

Having the sample project installed is a good way to be notified of new releases.

Gradle Dependency (jcenter)

Easily reference the library in your Android projects using this dependency in your module's build.gradle file:

gradle
dependencies {
    compile 'com.thefinestartist:ytpa:1.2.1'
}

Requirements

It supports Android API 7+.

Features

  • Orientation Support

    • AUTO
    • AUTO_START_WITH_LANDSCAPE
    • ONLY_LANDSCAPE
    • ONLY_PORTRAIT
  • Media Volume Support

    • While watching YouTube Player, users should be able to set media volume!!!
  • Video Play Error Support

    • If the video is not playable, it send to youtube app or other browser which will might play it.
  • Animation Support

    • Activity closing animation can be customized.
  • Status Bar Support

    • On screen portrait mode, it removed status bar automatically.

Set Up AndroidManifest.xml

xml

Usage

…

YouTubeUrlParser

This util helps to retrieve youtube video id from youtube url or vice versa. Reference

java
String vidoeId = YouTubeUrlParser.getVideoId(videoUrl);
String vidoeUrl = YouTubeUrlParser.getVideoUrl(videoId);

YouTubeApp

This util helps to open Youtube App and play specific video.

java
YouTubeApp.startVideo(context, videoId);

YouTubeThumbnail

This util returns Youtube thumbnail image url.

java
YouTubeThumbnail.getUrlFromVideoId(videoId, Quality.HIGH);

License

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言