-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
110 additions
and
22 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
mediamp-api/src/androidMain/kotlin/MediampPlayer.android.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright (C) 2024 OpenAni and contributors. | ||
* | ||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. | ||
* Use of this source code is governed by the Apache-2.0 license, which can be found at the following link. | ||
* | ||
* https://github.com/open-ani/mediamp/blob/main/LICENSE | ||
*/ | ||
|
||
package org.openani.mediamp | ||
|
||
import android.net.Uri | ||
import android.os.Build | ||
import androidx.annotation.RequiresApi | ||
import java.nio.file.Path | ||
|
||
|
||
/** | ||
* Plays the video at the specified [uri]. | ||
*/ | ||
public suspend inline fun MediampPlayer.playUri(uri: Uri): Unit = | ||
playUri(uri.toString()) | ||
|
||
|
||
/** | ||
* Plays the file. | ||
*/ | ||
@RequiresApi(Build.VERSION_CODES.O) | ||
public suspend inline fun MediampPlayer.playFile(file: Path): Unit = | ||
playUri(file.toUri().toString()) |
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
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
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
18 changes: 18 additions & 0 deletions
18
mediamp-api/src/desktopMain/kotlin/MediampPlayer.desktop.kt
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/* | ||
* Copyright (C) 2024 OpenAni and contributors. | ||
* | ||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. | ||
* Use of this source code is governed by the Apache-2.0 license, which can be found at the following link. | ||
* | ||
* https://github.com/open-ani/mediamp/blob/main/LICENSE | ||
*/ | ||
|
||
package org.openani.mediamp | ||
|
||
import java.nio.file.Path | ||
|
||
/** | ||
* Plays the file. | ||
*/ | ||
public suspend inline fun MediampPlayer.playFile(file: Path): Unit = | ||
playUri(file.toUri().toString()) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Copyright (C) 2024 OpenAni and contributors. | ||
* | ||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. | ||
* Use of this source code is governed by the Apache-2.0 license, which can be found at the following link. | ||
* | ||
* https://github.com/open-ani/mediamp/blob/main/LICENSE | ||
*/ | ||
|
||
package org.openani.mediamp | ||
|
||
import java.io.File | ||
import java.net.URI | ||
import java.net.URL | ||
|
||
/** | ||
* Plays the video at the specified [uri]. | ||
*/ | ||
public suspend inline fun MediampPlayer.playUri(uri: URI): Unit = | ||
playUri(uri.toString()) | ||
|
||
/** | ||
* Plays the video at the specified [url]. | ||
*/ | ||
public suspend inline fun MediampPlayer.playUri(url: URL): Unit = | ||
playUri(url.toString()) | ||
|
||
|
||
/** | ||
* Plays the file. | ||
*/ | ||
public suspend fun MediampPlayer.playFile(file: File) { | ||
playUri(file.toURI().toString()) | ||
} |
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
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
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