{"id":28500754,"url":"https://github.com/kaltura/playkit-android-vr","last_synced_at":"2025-10-29T11:39:21.294Z","repository":{"id":33894328,"uuid":"97451492","full_name":"kaltura/playkit-android-vr","owner":"kaltura","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-28T09:50:24.000Z","size":7732,"stargazers_count":6,"open_issues_count":0,"forks_count":5,"subscribers_count":15,"default_branch":"develop","last_synced_at":"2025-06-08T15:07:41.849Z","etag":null,"topics":["360-video","android","kaltura","playkit","vr"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaltura.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-17T08:11:38.000Z","updated_at":"2025-02-26T16:40:40.000Z","dependencies_parsed_at":"2024-05-13T11:43:05.269Z","dependency_job_id":"40031945-d46a-4db9-b0a1-3f0d0056b143","html_url":"https://github.com/kaltura/playkit-android-vr","commit_stats":null,"previous_names":[],"tags_count":81,"template":false,"template_full_name":null,"purl":"pkg:github/kaltura/playkit-android-vr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fplaykit-android-vr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fplaykit-android-vr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fplaykit-android-vr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fplaykit-android-vr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaltura","download_url":"https://codeload.github.com/kaltura/playkit-android-vr/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fplaykit-android-vr/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263539339,"owners_count":23477454,"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":["360-video","android","kaltura","playkit","vr"],"created_at":"2025-06-08T15:07:41.742Z","updated_at":"2025-10-29T11:39:16.256Z","avatar_url":"https://github.com/kaltura.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI Status](https://github.com/kaltura/playkit-android-vr/actions/workflows/build.yml/badge.svg)](https://github.com/kaltura/playkit-android-vr/actions/workflows/build.yml)\n[![Download](https://img.shields.io/maven-central/v/com.kaltura.playkit/vrplugin?label=Download)](https://search.maven.org/artifact/com.kaltura.playkit/vrplugin)\n[![License](https://img.shields.io/badge/license-AGPLv3-black.svg)](https://github.com/kaltura/playkit-android-vr/blob/master/LICENSE)\n![Android](https://img.shields.io/badge/platform-android-green.svg)\n\n# playkit-android-vr\n\n## About Kaltura VR\n\nThe VR module gives ability to play VR and 360 streams\nbased on the MD360Player4Android having the same playkit player API\n\n## VR Integration  \n\nVR Module is build on top of the Kaltura Playkit SDK; therefore, to get started, you'll need to add dependencies in your application build.gradle file.\n\n```\ndependencies {\n    implementation 'com.kaltura:playkit-android-vr:XXX' //instead of XXX use latest version. \n   \n}\n\nrepositories {\n    maven { url 'https://jitpack.io' }\n}\n```\n\nNext, lets see how to use the VR Module in your application.\n\nThere are 2 possibilities to Generate PKMediaEntry\n* Using Providers (OVP/Phoenix)\n* Creating it manually\n\nVR Module can work in 2 Modes 360 Player or Cardboard Player Mode\nfor each mode application can configure the InteractionMode for each Player.\nThe default InteractionMode is VRInteractionMode.Touch\n\n```java \npublic enum VRInteractionMode {\n    Motion,                  //360 Player\n    Touch,                   //360 Player\n    MotionWithTouch,         //360 Player\n    CardboardMotion,         //Cardbord Player\n    CardboardMotionWithTouch //Cardbord Player\n}\n```\n\n### Using Providers:\nin case the media entry is generated using the Providers if 360 meida was requested the callback of the provider will create a VRPKMediaEntry instead of \nthe PKMediaEntry that is created for regular media.\nThe `VRPKMediaEntry` will be created with default VRSettings which application can set again or to change specific value using setter methods.\n\n\n```java\n//define app VR configuration\n((VRPKMediaEntry) vrMediaEntry).getVrSettings().setVrModeEnabled(isVrModeEnabled());\n((VRPKMediaEntry) vrMediaEntry).getVrSettings().setFlingEnabled(isFlingEnabled());\n((VRPKMediaEntry) vrMediaEntry).getVrSettings().setInteractionMode(getInteractionMode());\n((VRPKMediaEntry) vrMediaEntry).getVrSettings().setZoomWithPinchEnabled(isZoomWithPinchEnabled());\n``` \n\n### Manual Creation:\n```java\n//define app VR configuration\nVRSettings vrSettings = new VRSettings()\n           .setVrModeEnabled(isVrModeEnabled())\n           .setFlingEnabled(isFlingEnabled())\n           .setInteractionMode(VRInteractionMode.MotionWithTouch)\n           .setZoomWithPinchEnabled(isZoomWithPinchEnabled());\n\n\nPKMediaEntry vrMediaEntry = new VRPKMediaEntry().setVRParams(vrSettings);\n        //Set additional data for the entry.\n        vrMediaEntry.setId(\"entryId\");\n        vrMediaEntry.setMediaType(PKMediaEntry.MediaEntryType.Vod);\n        List\u003cPKMediaSource\u003e mediaSources = createMediaSources();\n        vrMediaEntry.setSources(mediaSources);```\n```\n\n## VR Controller\n\nOnce Player is set there are several operartions that can control the VR Module behaviour:\n\n```java\npublic interface VRController extends PKController {\n\n\n    /**\n     * When set to true, will split screen in a way that fit to cardboard devices.\n     * When set to false, content will be displayed in an ordinary 360 way.\n     * @param shouldEnable - if enable VRMode.\n     */\n    void enableVRMode(boolean shouldEnable);\n\n    /**\n     * When set to true, will allow some continiues motion effect when surface is swiped.\n     * If disabled, motion will stop whenever MotionEvent.ACTION_UP/MotionEvent.ACTION_CANCEL detected.\n     * @param shouldEnable - if enable this.\n     */\n    void setFlingEnabled(boolean shouldEnable);\n\n    /**\n     * Set the Interaction mode with 360/VR surface.\n     * Before applying, application must check if requested mode is supported by the device.\n     * @param mode - requested mode.\n     */\n    void setInteractionMode(VRInteractionMode mode);\n\n    /**\n     * Allows to enable zooming of the surface with pinch motion.\n     * @param shouldEnable - if this should be enabled.\n     */\n    void setZoomWithPinchEnabled(boolean shouldEnable);\n\n    /**\n     * Set clickListener on the 360/VR surface. When application wants to detect\n     * click input on the 360/VR surface it is required to pass it here instead of\n     * just attaching it to the containerView.\n     * @param onClickListener - View.ClickListener\n     */\n    void setOnClickListener(View.OnClickListener onClickListener);\n\n    /**\n     * @return - true if in vr mode. otherwise false.\n     */\n    boolean isVRModeEnabled();\n\n    /**\n     * @return - true if pinch is enabled.\n     */\n    boolean isPinchEnabled();\n\n    /**\n     * @return - true if enabled.\n     */\n    boolean isFlingEnabled();\n\n    /**\n     *\n     * @return - current interaction mode.\n     */\n    VRInteractionMode getInteractionMode();\n}\n```\n#### Getting access to the controller\n```\nVRController vrController = mPlayer.getController(VRController.class);\n```\n### Validating Mode Change is supported by device. \nBefore applying InteractionMode(no matter if by calling api setInteractionMode() or change in in VRSettings setInteractionMode()) you should first check if this mode is supported by the device. In some cases device hardware does not support requested mode(for example InteractionMode.Motion not supported for devices without Gyro)\n\n``` java \n boolean modeSupported = VRUtil.isModeSupported(context, VRInteractionMode.CardboardMotion);\n if (modeSupported) {\n \tvrController.setInteractionMode(VRInteractionMode.CardboardMotion);\n }\n                        \n```\n\n### Example - Change The VR Mode During Playback:\n\n```java\n case TOGGLE_VR:\n                VRController vrController = mPlayer.getController(VRController.class);\n                boolean currentState = vrController.isVRModeEnabled();\n                vrController.enableVRMode(!currentState);\n                break;\n        }\n\n```\n\n### Example - Listen to clicks on surface \nApp must pass the click listener via the controller\n\n```java\nVRController vrController = mPlayer.getController(VRController.class);\n            mPlayerControlsView.setVrIconVisibility(true);                                               mPlayerControlsView.setVRActivated(vrController.isVRModeEnabled());\n            vrController.setOnClickListener(new View.OnClickListener() {\n                @Override\n               public void onClick(View v) {\n                     //application code for handaling ui operations\n                     handleContainerClick();\n               }\n           });\n}\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaltura%2Fplaykit-android-vr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaltura%2Fplaykit-android-vr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaltura%2Fplaykit-android-vr/lists"}