Skip to content

Commit

Permalink
FIx a crash on devices without Play Services
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed Jan 15, 2017
1 parent bee0765 commit 5bb16e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId 'com.stevenschoen.putionew'
minSdkVersion 19
targetSdkVersion 25
versionCode 111
versionName '4.0.9'
versionCode 113
versionName '4.0.10'
multiDexEnabled true
}
buildTypes {
Expand Down Expand Up @@ -82,7 +82,7 @@ dependencies {
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.tbruyelle.rxpermissions:rxpermissions:0.9.1@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.aurelhubert:ahbottomnavigation:2.0.2'
compile 'com.aurelhubert:ahbottomnavigation:2.0.3'
compile 'nz.bradcampbell:paperparcel:2.0.0-beta1'
kapt 'nz.bradcampbell:paperparcel-compiler:2.0.0-beta1'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ import org.apache.commons.io.FilenameUtils

abstract class BaseCastActivity : AppCompatActivity(), PutioApplication.CastCallbacks {

companion object {
const val FRAGTAG_CAST_MINI_CONTROLLER = "mini_cast"
}

protected val castContext: CastContext?
get() = CastContext.getSharedInstance(this)
protected val castSession: CastSession?
Expand Down Expand Up @@ -57,7 +53,8 @@ abstract class BaseCastActivity : AppCompatActivity(), PutioApplication.CastCall
}

override fun load(file: PutioFile, url: String, utils: PutioUtils) {
if (castContext != null && castSession != null && castSession!!.remoteMediaClient != null && castSession!!.isConnected) {
if (CastOptionsProvider.isCastSdkAvailable(this) &&
castContext != null && castSession != null && castSession!!.remoteMediaClient != null && castSession!!.isConnected) {
fun play(subtitles: List<PutioSubtitle>? = null) {
val metaData = MediaMetadata(
if (file.isVideo)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.github.ben-manes.versions'

buildscript {
ext.kotlin_version = '1.0.5-3'
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
Expand Down

0 comments on commit 5bb16e1

Please sign in to comment.