{"id":19224818,"url":"https://github.com/flipkart-incubator/android-inline-youtube-view","last_synced_at":"2025-04-07T05:14:08.969Z","repository":{"id":28567058,"uuid":"118744775","full_name":"flipkart-incubator/android-inline-youtube-view","owner":"flipkart-incubator","description":"Utility library around using YouTube inside your android app.","archived":false,"fork":false,"pushed_at":"2021-11-13T09:29:38.000Z","size":33639,"stargazers_count":321,"open_issues_count":9,"forks_count":62,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-03-30T22:11:57.329Z","etag":null,"topics":["android","fragments","fullscreen-videos","inline","inline-video","inline-youtube","ios","react","webview","youtube","youtube-player","youtube-sdk"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flipkart-incubator.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-24T09:43:44.000Z","updated_at":"2025-02-07T09:53:49.000Z","dependencies_parsed_at":"2022-08-02T12:11:51.383Z","dependency_job_id":null,"html_url":"https://github.com/flipkart-incubator/android-inline-youtube-view","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fandroid-inline-youtube-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fandroid-inline-youtube-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fandroid-inline-youtube-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flipkart-incubator%2Fandroid-inline-youtube-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flipkart-incubator","download_url":"https://codeload.github.com/flipkart-incubator/android-inline-youtube-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247595335,"owners_count":20963943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","fragments","fullscreen-videos","inline","inline-video","inline-youtube","ios","react","webview","youtube","youtube-player","youtube-sdk"],"created_at":"2024-11-09T15:12:56.377Z","updated_at":"2025-04-07T05:14:08.945Z","avatar_url":"https://github.com/flipkart-incubator.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# inline-youtube-view \n\n[![](https://jitpack.io/v/flipkart-incubator/inline-youtube-view.svg)](https://jitpack.io/#flipkart-incubator/android-inline-youtube-view) [![Build Status](https://travis-ci.org/flipkart-incubator/android-inline-youtube-view.svg?branch=master)](https://travis-ci.org/flipkart-incubator/android-inline-youtube-view) \n\nYouTube component for Android, iOS and React. This is a suite of utility libraries around using YouTube inside your [Android](https://github.com/flipkart-incubator/inline-youtube-view/), [iOS](https://github.com/flipkart-incubator/ios-inline-youtube-view/) or React Native app.\n\n# youtube-android\n\nPlaying Youtube on Android (specially inline) comes with some challenges :  \n   - YouTube SDK does not work on all devices ( where YouTube services could have been uninstalled)\n   - You cannot run more than one instance of the YouTube view\n   - Playing them inline where in a list you can have more than one videos in a single list. \n   \ninline-youtube-view for Android checks if the services are available and will fall back gracefully to using WebView in the event they are not. \n\nYouTubePlayerView : The YouTubePlayerView provided by the YouTube SDK comes with a restriction that the activty hosting this needs to extend from YouTubeBaseActivity. This view removes these restrictions. \n\n## Demo Gifs\n\n### YouTubePlayer in Activity (Fullscreen Mode)\n\n![YouTube Activity](https://github.com/flipkart-incubator/inline-youtube-view/blob/master/youtube-activity-android.gif)\n\n### YouTubePlayer in Fragment (inline native)\n\n![YouTube Fragment](https://github.com/flipkart-incubator/inline-youtube-view/blob/master/youtube-fragment-android.gif)\n\n## How to use ?\n\nAdd it in your root build.gradle at the end of repositories :\n\n````java\nallprojects {\n   repositories {\n     ...\n     maven { url \"https://jitpack.io\" }\n   }\n}\n````\n\nAdd the dependency\n\n````java\ndependencies {\n    implementation 'com.github.flipkart-incubator:android-inline-youtube-view:1.0.3'\n}\n````\n\n### YouTubePlayer Activity\n\nStart an YouTubeActivity intent with apiKey and videoId. This will play the youtube video in a new activity in fullscreen mode.\n\n````java\nIntent intent = new Intent(MainActivity.this, YouTubeActivity.class);\nintent.putExtra(\"apiKey\", Constants.API_KEY);\nintent.putExtra(\"videoId\", \"3AtDnEC4zak\");\nstartActivity(intent);\n````\n\nAlso, make sure that you add the activity in the AndroidManifest.xml file.\n\n````java\n\u003cactivity android:name=\"com.flipkart.youtubeview.activity.YouTubeActivity\" /\u003e\n````\n\n### YouTubePlayer Inline\n\nCreate an instance of YouTubePlayerView inside a fragment. To initialize the player, you need to call the initPlayer method with following params:\n1. apiKey\n2. videoId\n3. webviewUrl : the link to iframe.html file (this is required when the device is not able to render native video, a fallback). By default, use 'https://cdn.rawgit.com/flipkart-incubator/inline-youtube-view/60bae1a1/youtube-android/youtube_iframe_player.html'\n4. playerType : native, webview or auto (try native, else fallback to webview)\n5. listener : callback listener\n6. fragment : fragment hosting this view\n7. imageLoader : to load thumbnail image\n\n````java\nYouTubePlayerView playerView = new YouTubePlayerView(context);\nplayerView.initPlayer(Constants.API_KEY, videoId, \"https://cdn.rawgit.com/flipkart-incubator/inline-youtube-view/60bae1a1/youtube-android/youtube_iframe_player.html\", playerType, listener, fragment, imageLoader);\n\n````\n\n## YouTube iOS Player\n\nWe have open-sourced the inline-youtube-player for [iOS](https://github.com/flipkart-incubator/ios-inline-youtube-view) also.\n\n## Contributing\n\nThe easiest way to contribute is by [forking the repo](https://help.github.com/articles/fork-a-repo/), making your changes and [creating a pull request](https://help.github.com/articles/creating-a-pull-request/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipkart-incubator%2Fandroid-inline-youtube-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflipkart-incubator%2Fandroid-inline-youtube-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflipkart-incubator%2Fandroid-inline-youtube-view/lists"}