This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(avengers!= null && avenger.haveInfinityStones()) { | |
destroyThanos(avengers); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeStone: String = "Dr Strange" | |
timeStone = null | |
//Here thanos(null value) will destroy our timeStone then we can't use gaunet (compilation error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var timeStone: String? = "Dr Strange" | |
timeStone = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if(avengers?.haveInfinityStones()){ | |
destroyThanos(avengers) | |
} | |
Or | |
if(avengers!!.haveInfinityStones()){ | |
destroyThanos(avengers) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val result = nullableVariable?.someMethodCall() ?: fallbackIfNullMethodCall() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<com.google.android.exoplayer2.ui.StyledPlayerView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:id="@+id/player_exo" | |
app:use_controller="true" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun initPlayer() { | |
player = SimpleExoPlayer.Builder(this).build() | |
player?.playWhenReady = true | |
player_exo.player = player | |
val defaultHttpDataSourceFactory = DefaultHttpDataSourceFactory("ExoPlayerDemoUserAgent") | |
val mediaItem = MediaItem.fromUri("uri") | |
val mediaSource = | |
HlsMediaSource.Factory(defaultHttpDataSourceFactory).createMediaSource(mediaItem) | |
player?.setMediaSource(mediaSource) | |
player?.seekTo(playbackPosition) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun onStart() { | |
super.onStart() | |
if (Util.SDK_INT >= 24) { | |
initPlayer() | |
} | |
} | |
override fun onStop() { | |
super.onStop() | |
if (Util.SDK_INT >= 24) { | |
releasePlayer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app:show_buffering="when_playing" | |
app:use_sensor_rotation="true|false" | |
app:show_subtitle_button="true|false" | |
app:show_fastforward_button="true|false" | |
app:show_rewind_button="true|false" | |
app:fastforward_increment="15000"//in ms i.e 15s | |
app:rewind_increment="15000" | |
app:show_next_button="true|false" | |
app:show_previous_button="true|false" | |
app:resize_mode="fill|fit|zoom|fixed_height|fixed_width" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun DefaultTrackSelector.generateQualityList(): ArrayList<Pair<String, TrackSelectionOverrides.Builder>> { | |
//Render Track -> TRACK GROUPS (Track Array)(Video,Audio,Text)->Track | |
val trackOverrideList = ArrayList<Pair<String, TrackSelectionOverrides.Builder>>() | |
val renderTrack = this.currentMappedTrackInfo | |
val renderCount = renderTrack?.rendererCount ?: 0 | |
for (rendererIndex in 0 until renderCount) { | |
if (isSupportedFormat(renderTrack, rendererIndex)) { | |
val trackGroupType = renderTrack?.getRendererType(rendererIndex) | |
val trackGroups = renderTrack?.getTrackGroups(rendererIndex) |
OlderNewer