百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
Y

YouTubePlayerActivity

> 编程语言
开源

Android Youtube 播放器活动。只需传递一个 URL 即可在新活动中播放 Youtube 视频。它支持屏幕方向、媒体音量控制等。

389 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Android Youtube 播放器活动。只需传递一个 URL 即可在新活动中播放 Youtube 视频。它支持屏幕方向、媒体音量控制等。

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 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Java

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

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