@LargeTest @Throws(Exception::class) fun testMediaVideoItemRenderingModes() { val videoItemFileName: String = INPUT_FILE_PATH + "H263_profile0_176x144_15fps_256kbps_AACLC_32kHz_128kbps_s_0_26.3gp" val videoItemRenderingMode: Int = MediaItem.RENDERING_MODE_BLACK_BORDER var flagForException = false val mediaVideoItem1: MediaVideoItem = mVideoEditorHelper.createMediaItem( mVideoEditor, "mediaVideoItem1", videoItemFileName, videoItemRenderingMode ) mVideoEditor.addMediaItem(mediaVideoItem1)  mediaVideoItem1.setRenderingMode(MediaItem.RENDERING_MODE_CROPPING) assertEquals( "MediaVideo Item rendering Mode", MediaItem.RENDERING_MODE_CROPPING, mediaVideoItem1.getRenderingMode() ) try { mediaVideoItem1.setRenderingMode(MediaItem.RENDERING_MODE_CROPPING + 911) } catch (e: IllegalArgumentException) { flagForException = true } assertTrue("Media Item Invalid rendering Mode", flagForException) flagForException = false try { mediaVideoItem1.setRenderingMode(MediaItem.RENDERING_MODE_BLACK_BORDER - 11) } catch (e: IllegalArgumentException) { flagForException = true } assertTrue("Media Item Invalid rendering Mode", flagForException) assertEquals( "MediaVideo Item rendering Mode", MediaItem.RENDERING_MODE_CROPPING, mediaVideoItem1.getRenderingMode() ) mediaVideoItem1.setRenderingMode(MediaItem.RENDERING_MODE_STRETCH) assertEquals( "MediaVideo Item rendering Mode", MediaItem.RENDERING_MODE_STRETCH, mediaVideoItem1.getRenderingMode() ) }
To test creation of Media Video Item with Set and Get rendering Mode