diff --git a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt index 575ea1d..50bca1b 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt @@ -318,6 +318,10 @@ class ReproductorActivity : AppCompatActivity() { private var mOriginalSystemUiVisibility: Int = 0 override fun getDefaultVideoPoster(): Bitmap? { + AsyncTask.execute { + this@ReproductorActivity._actions.watchVideo(this@ReproductorActivity.video.id, ManagerSingleton.token.token) + } + return if (mCustomView == null) { null } else BitmapFactory.decodeResource(this@ReproductorActivity.resources, 2130837573) @@ -377,6 +381,5 @@ class ReproductorActivity : AppCompatActivity() { err.printStackTrace() } } - } } diff --git a/app/src/main/java/org/libre/agosto/p2play/ajax/Actions.kt b/app/src/main/java/org/libre/agosto/p2play/ajax/Actions.kt index 47a0b47..412d776 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ajax/Actions.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ajax/Actions.kt @@ -144,4 +144,22 @@ class Actions: Client() { return response } + + fun watchVideo(videoId: Int, token: String): Boolean { + val con = this._newCon("videos/$videoId/watching", "PUT", token) + val params = "currentTime=1" + con.outputStream.write(params.toByteArray()) + + var response = false + try { + if(con.responseCode == 204){ + response = true + } + } catch (err: Exception) { + err.printStackTrace() + response = false + } + + return response + } } \ No newline at end of file diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 7919a24..0c4fe54 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -8,7 +8,7 @@ Sobre P2Play P2Play es una aplicacion no-oficial de PeerTube. Tu puedes ver y cntribuir con el codigo en GitLab: - Puedes subscribirte a nuestro perfil en GNU Social: + Puedes seguir nuestro blog: Copyleft GNU GPLv3 License Sobre la instancia Para ver los terminos y mas visita la web: diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 27c740d..160ac6b 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -12,10 +12,10 @@ https://gitlab.com/agosto182/p2play/ - https://gnusocial.ml/p2play + https://personaljournal.ca/p2play/ About P2Play P2Play is an Android application unnoficial of PeerTube. You can watch and contribute with the code on GitLab: - You can subscribe to our profile on GNU Social: + You can follow our blog: Copyleft GNU GPLv3 License About instance You can see terms and more on the web: