//主屏activity内privateMediaRouter mMediaRouter;privateSecondDisplay secondDisplay;//控制副屏显隐publicvoidonSecondChange(View view){if(secondDisplay ==null){showSecondScreen();}else{closeSecondScreen();}}//====================================privatevoidshowSecondScreen(){if(secondDisplay !=null){return;}mMediaRouter =(MediaRouter)getSystemService(Context.MEDIA_ROUTER_SERVICE);updatePresentation();}privatevoidcloseSecondScreen(){if(secondDisplay !=null){secondDisplay.release();secondDisplay.dismiss();secondDisplay =null;}}privatevoidupdatePresentation(){// Get the current route and its presentation display.MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);Display presentationDisplay = route !=null? route.getPresentationDisplay():null;// Dismiss the current presentation if the display has changed.if(secondDisplay !=null&& secondDisplay.getDisplay()!= presentationDisplay){secondDisplay.dismiss();secondDisplay =null;}// Show a new presentation if needed.if(secondDisplay ==null&& presentationDisplay !=null){secondDisplay =newSecondDisplay(this, presentationDisplay);secondDisplay.setOnDismissListener(mOnDismissListener);try{secondDisplay.show();}catch(WindowManager.InvalidDisplayException ex){secondDisplay =null;ex.printStackTrace();}}}//副屏关闭监听privatefinalDialogInterface.OnDismissListener mOnDismissListener =newDialogInterface.OnDismissListener(){@OverridepublicvoidonDismiss(DialogInterface dialog){if(dialog == secondDisplay){secondDisplay =null;}}};
一、vitepress打包编译报错Element is missing end tag. 背景: 新增了一些笔记准备上传到git仓库,持续集成部署的时候,控制台报错了,错误信息如下: SyntaxError: Element is missing end tag. 仔细看了下控制台几乎没啥…