1"use strict";(self.webpackChunkdocusaurus=self.webpackChunkdocusaurus||[]).push([[6840],{27560:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>c,contentTitle:()=>i,default:()=>s,frontMatter:()=>r,metadata:()=>l,toc:()=>h});var t=o(74848),a=o(28453);const r={id:"chromecast",title:"Setup Chromecast Through VdoCipher Android SDK",sidebar_label:"Chromecast"},i=void 0,l={id:"mobile/android/chromecast",title:"Setup Chromecast Through VdoCipher Android SDK",description:"Overview",source:"@site/docs/mobile/android/chromecast.md",sourceDirName:"mobile/android",slug:"/mobile/android/chromecast",permalink:"/docs/mobile/android/chromecast",draft:!1,unlisted:!1,tags:[],version:"current",frontMatter:{id:"chromecast",title:"Setup Chromecast Through VdoCipher Android SDK",sidebar_label:"Chromecast"}},c={},h=[{value:"Overview",id:"overview",level:2},{value:"Setup chromecast",id:"setup-chromecast",level:2},{value:"With VdoCipher Player UI",id:"with-vdocipher-player-ui",level:3},{value:"1. Enable Chromecast",id:"1-enable-chromecast",level:4},{value:"2. Enable Chromecast controller",id:"2-enable-chromecast-controller",level:4},{value:"3. Customization of the Mini controller",id:"3-customization-of-the-mini-controller",level:4},{value:"Show or hide album art",id:"show-or-hide-album-art",level:5},{value:"Change the background of the mini controller",id:"change-the-background-of-the-mini-controller",level:5},{value:"Change the drawable of buttons",id:"change-the-drawable-of-buttons",level:5},{value:"Change the color of seekbar",id:"change-the-color-of-seekbar",level:5},{value:"4. Customization of the ExpandedController(Full screen controller activity)",id:"4-customization-of-the-expandedcontrollerfull-screen-controller-activity",level:4},{value:"With Custom Implementation",id:"with-custom-implementation",level:3}];function d(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",h4:"h4",h5:"h5",p:"p",pre:"pre",...(0,a.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,t.jsx)(n.p,{children:"The VdoCipher Android SDK offers the capability to play videos on Google Chromecast. Google Chromecast is supoorted on Android devices running Marshmallow and above (API level 23+)."}),"\n",(0,t.jsx)(n.h2,{id:"setup-chromecast",children:"Setup chromecast"}),"\n",(0,t.jsx)(n.p,{children:"There are two ways to create a player, one with default controls and other using custom implementation. So, we have two methods to enable Chromecast in the player."}),"\n",(0,t.jsx)(n.h3,{id:"with-vdocipher-player-ui",children:"With VdoCipher Player UI"}),"\n",(0,t.jsx)(n.p,{children:"Steps to use chromecast with default controls:"}),"\n",(0,t.jsx)(n.h4,{id:"1-enable-chromecast",children:"1. Enable Chromecast"}),"\n",(0,t.jsx)(n.p,{children:'First, we need to enable Chromecast in the player configuration from the video dashboard. After enabling the chromecast using player configuration, the Player UI fragment "VdoPlayerUIFragment" shows a Chromecast icon on the top right corner of the player which will be enabled automatically when any Chromecast device is scanned into the network.'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'<fragment\n android:name="com.vdocipher.aegis.ui.view.VdoPlayerUIFragment"\n android:id="@+id/vdo_player_fragment"\n android:layout_width="match_parent"\n android:layout_height="wrap_content"\n android:layout_gravity="center"\n android:keepScreenOn="true"/>\n \x3c!-- app:handleBackPress="false" to handle back press actions in activity\'s onBackPressed()--\x3e\n'})}),"\n",(0,t.jsx)(n.h4,{id:"2-enable-chromecast-controller",children:"2. Enable Chromecast controller"}),"\n",(0,t.jsx)(n.p,{children:'Once the video starts casting/playing on chromecast device, app requires\na video controller which contains options to manage the video on Android TV. To control video from app,\nintegrate the mini ui controller.\nThe fragment for mini ui controller should be added into\nthe same xml file where "VdoPlayerUIFragment" has been added.'}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'\n<fragment\n android:name="
1com.vdocipher.aegis.ui.view.VdoPlayerUIFragment"\n .\n .\n ./>\n\n....\n\n<fragment\n android:id="@+id/cast_mini_controller"\n android:layout_width="match_parent"\n android:layout_height="wrap_content"\n android:layout_alignParentBottom="true"\n android:visibility="gone"\n app:castShowImageThumbnail="true"\n app:castForward30ButtonDrawable="@drawable/ic_forward"\n app:castBackground="@color/white"\n app:castControlButtons="@array/cast_mini_controller_control_buttons"\n class="com.vdocipher.aegis.cast.CustomMiniControllerFragment" >\n</fragment>\n\n'})}),"\n",(0,t.jsx)(n.p,{children:"While casting the video, your app will show a mini controller on the bottom of the screen.\nThis mini controller will display the information of the video which is casting on the chromecast. After clicking on the mini controller, you can also see an Expandable UI controller having multiple options to control the video from app."}),"\n",(0,t.jsx)(n.h4,{id:"3-customization-of-the-mini-controller",children:"3. Customization of the Mini controller"}),"\n",(0,t.jsx)(n.p,{children:"To customize the UI of mini controller, below code can be added to the Mini controller fragment :"}),"\n",(0,t.jsx)(n.h5,{id:"show-or-hide-album-art",children:"Show or hide album art"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'...\napp:castShowImageThumbnail="false"\n...\n'})}),"\n",(0,t.jsx)(n.h5,{id:"change-the-background-of-the-mini-controller",children:"Change the background of the mini controller"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'...\napp:castBackground="@color/white"\n...\n'})}),"\n",(0,t.jsx)(n.h5,{id:"change-the-drawable-of-buttons",children:"Change the drawable of buttons"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'...\napp:castPauseButtonDrawable="@drawble/ic_pause"\napp:castPlayButtonDrawable="@drawble/ic_play"\n...\n'})}),"\n",(0,t.jsx)(n.h5,{id:"change-the-color-of-seekbar",children:"Change the color of seekbar"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-xml",children:'...\napp:castProgressBarColor="#00ffff"\n...\n'})}),"\n",(0,t.jsx)(n.h4,{id:"4-customization-of-the-expandedcontrollerfull-screen-controller-activity",children:"4. Customization of the ExpandedController(Full screen controller activity)"}),"\n",(0,t.jsx)(n.p,{children:"Player configuration from dashboard can be directly applied to the ExpandedController for customization.\nSo, the button and actionable items can be hidden/shown from dashboard configuration."}),"\n",(0,t.jsx)(n.p,{children:"Once the mini controller is visible then a cast notification will be displayed in the notification tray and the ExpandedController can be opened from the notification."}),"\n",(0,t.jsx)(n.h3,{id:"with-custom-implementation",children:"With Custom Implementation"}),"\n",(0,t.jsxs)(n.p,{children:["Chromecast can also be added to VdoPlayerUIFragment with custom controls. A sample app has been created to implement the chromecast into the player. Please refer to the link:\n",(0,t.jsx)(n.a,{href:"https://github.com/VdoCipher/sample-android-app",children:"Sample Android App"})]}),"\n",(0,t.jsx)(n.p,{children:"Note: Most android TV supports the Google Chromecast or also have an in-built chromecast option."}),"\n",(0,t.jsx)(n.p,{children:"Enjoy casting."})]})}function s(e={}){const{wrapper:n}={...(0,a.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(d,{...e})}):d(e)}},28453:(e,n,o)=>{o.d(n,{R:()=>i,x:()=>l});var t=o(96540);const a={},r=t.createContext(a);function i(e){const n=t.useContext(r);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(a):e.components||a:i(e.components),t.createElement(r.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.