{"id":13848142,"url":"https://github.com/yqritc/Android-ScalableVideoView","last_synced_at":"2025-07-12T11:33:32.695Z","repository":{"id":33595302,"uuid":"37247430","full_name":"yqritc/Android-ScalableVideoView","owner":"yqritc","description":"Android Texture VideoView having a variety of scale types like the scale types of ImageView such as fitCenter, centerCrop, centerTopCrop and more","archived":false,"fork":false,"pushed_at":"2022-07-20T05:20:01.000Z","size":11212,"stargazers_count":1088,"open_issues_count":37,"forks_count":224,"subscribers_count":24,"default_branch":"master","last_synced_at":"2024-11-19T18:11:46.539Z","etag":null,"topics":[],"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/yqritc.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":"2015-06-11T07:56:38.000Z","updated_at":"2024-10-05T17:10:08.000Z","dependencies_parsed_at":"2022-09-03T04:42:47.585Z","dependency_job_id":null,"html_url":"https://github.com/yqritc/Android-ScalableVideoView","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yqritc%2FAndroid-ScalableVideoView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yqritc%2FAndroid-ScalableVideoView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yqritc%2FAndroid-ScalableVideoView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yqritc%2FAndroid-ScalableVideoView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yqritc","download_url":"https://codeload.github.com/yqritc/Android-ScalableVideoView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225809025,"owners_count":17527426,"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":[],"created_at":"2024-08-04T19:00:42.983Z","updated_at":"2024-11-21T23:31:02.530Z","avatar_url":"https://github.com/yqritc.png","language":"Java","funding_links":[],"categories":["Java","Libs"],"sub_categories":["\u003cA NAME=\"Widget\"\u003e\u003c/A\u003eWidget"],"readme":"# Android-ScalableVideoView\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-ScalableVideoView-green.svg?style=flat)](https://android-arsenal.com/details/1/2045)\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Download](https://api.bintray.com/packages/yqritc/maven/android-scalablevideoview/images/download.svg)](https://bintray.com/yqritc/maven/android-scalablevideoview/_latestVersion)\n\n*__Looking for the extra scale types of ImageView? [Check out ScalableImageView.](https://github.com/yqritc/Android-ScalableImageView)__*  \n\nAndroid Texture VideoView having a variety of scale types like the scale types of ImageView.\n\n![Sample](/sample/sample.gif)\n\n# Sample\n\u003ca href=\"https://play.google.com/store/apps/details?id=com.yqritc.scalablevideoview.sample\"\u003e\u003cimg src=\"http://developer.android.com/images/brand/en_app_rgb_wo_60.png\"/\u003e\u003c/a\u003e\n\n# Release Note\n\n[Release Note] (https://github.com/yqritc/Android-ScalableVideoView/releases)\n\n# Gradle\n```\nrepositories {\n    jcenter()\n}\n\ndependencies {\n    compile 'com.yqritc:android-scalablevideoview:1.0.4'\n}\n```\n\n# Support Scale Types  \n\n### Scale to fit \n- fitXY\n- fitStart\n- fitCenter\n- fitEnd\n\n### No Scale\n- leftTop\n- leftCenter\n- leftBottom\n- centerTop\n- center\n- centerBottom\n- rightTop\n- rightCenter\n- rightBottom\n\n### Crop\n- leftTopCrop\n- leftCenterCrop\n- leftBottomCrop\n- centerTopCrop\n- centerCrop\n- centerBottomCrop\n- rightTopCrop\n- rightCenterCrop\n- rightBottomCrop\n\n### Scale Inside\n- startInside\n- centerInside\n- endInside\n\n\n# Usage\n\n### Set scale type in layout file\n```\n\u003ccom.yqritc.scalablevideoview.ScalableVideoView\n  android:id=\"@+id/video_view\"\n  android:layout_width=\"match_parent\"\n  android:layout_height=\"match_parent\"\n  android:layout_marginBottom=\"100dp\"\n  app:scalableType=\"fitCenter\"/\u003e\n```\nPlease refere the following xml for the list of scalableType you can set.  \n[attrs.xml](https://github.com/yqritc/Android-ScalableVideoView/blob/master/library/src/main/res/values/attrs.xml)\n\n### Sample usage in source code\n```\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n  super.onCreate(savedInstanceState);\n  setContentView(R.layout.activity_main);\n  \n  mVideoView = (ScalableVideoView) findViewById(R.id.video_view);\n  try {\n    mVideoView.setRawData(R.raw.landscape_sample);\n  } catch (IOException ioe) {\n    //handle error\n  }\n}\n\n@Override\npublic void onClick(View v) {\n  switch (v.getId()) {\n    case R.id.btn_start:\n        mVideoView.start();\n        break;\n    case R.id.btn_update_scale:\n        mVideoView.setScalableType(ScalableType.CENTER_TOP_CROP);\n        mVideoView.invalidate();\n        break;\n      default:\n        break;\n  }\n}\n```\n[ScalableVideoView](https://github.com/yqritc/Android-ScalableVideoView/blob/master/library/src/main/java/com/yqritc/scalablevideoview/ScalableVideoView.java) is extending TextureView to play video by using MediaPlayer.  \nBasic functionalities are defined in this class to play and scale video.  \nIf you need to control more, extend this class and define your custom video view.  \n\n\n# License\n```\nCopyright 2015 yqritc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyqritc%2FAndroid-ScalableVideoView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyqritc%2FAndroid-ScalableVideoView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyqritc%2FAndroid-ScalableVideoView/lists"}