@capgo/capacitor-media-session 7.2.9 → 8.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.author = package['author']
12
12
  s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
13
13
  s.source_files = 'ios/Sources/**/*.{swift,h,m,c,cc,mm,cpp}'
14
- s.ios.deployment_target = '14.0'
14
+ s.ios.deployment_target = '15.0'
15
15
  s.dependency 'Capacitor'
16
16
  s.swift_version = '5.1'
17
17
  end
package/Package.swift CHANGED
@@ -3,14 +3,14 @@ import PackageDescription
3
3
 
4
4
  let package = Package(
5
5
  name: "CapgoMediaSession",
6
- platforms: [.iOS(.v14)],
6
+ platforms: [.iOS(.v15)],
7
7
  products: [
8
8
  .library(
9
9
  name: "CapgoMediaSession",
10
10
  targets: ["MediaSessionPlugin"])
11
11
  ],
12
12
  dependencies: [
13
- .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "7.0.0")
13
+ .package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", from: "8.0.0")
14
14
  ],
15
15
  targets: [
16
16
  .target(
@@ -1,8 +1,8 @@
1
1
  ext {
2
2
  junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
3
- androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
4
- androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
5
- androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
3
+ androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.1'
4
+ androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.3.0'
5
+ androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.7.0'
6
6
  androidxMediaVersion = project.hasProperty('androidxMediaVersion') ? rootProject.ext.androidxMediaVersion : '1.7.0'
7
7
  }
8
8
 
@@ -12,18 +12,18 @@ buildscript {
12
12
  mavenCentral()
13
13
  }
14
14
  dependencies {
15
- classpath 'com.android.tools.build:gradle:8.7.2'
15
+ classpath 'com.android.tools.build:gradle:8.13.0'
16
16
  }
17
17
  }
18
18
 
19
19
  apply plugin: 'com.android.library'
20
20
 
21
21
  android {
22
- namespace "com.capgo.mediasession"
23
- compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
22
+ namespace = "com.capgo.mediasession"
23
+ compileSdk = project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 36
24
24
  defaultConfig {
25
- minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
26
- targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
25
+ minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 24
26
+ targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 36
27
27
  versionCode 1
28
28
  versionName "1.0"
29
29
  testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@@ -35,7 +35,7 @@ android {
35
35
  }
36
36
  }
37
37
  lintOptions {
38
- abortOnError false
38
+ abortOnError = false
39
39
  }
40
40
  compileOptions {
41
41
  sourceCompatibility JavaVersion.VERSION_21
@@ -30,7 +30,7 @@ import org.json.JSONObject;
30
30
  @CapacitorPlugin(name = "MediaSession")
31
31
  public class MediaSessionPlugin extends Plugin {
32
32
 
33
- private final String pluginVersion = "7.2.9";
33
+ private final String pluginVersion = "8.0.2";
34
34
 
35
35
  private static final String TAG = "CapgoMediaSession";
36
36
 
@@ -3,8 +3,8 @@ export interface MediaImage {
3
3
  sizes?: string;
4
4
  type?: string;
5
5
  }
6
- export declare type MediaSessionPlaybackState = 'none' | 'paused' | 'playing';
7
- export declare type MediaSessionAction = 'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto' | 'stop';
6
+ export type MediaSessionPlaybackState = 'none' | 'paused' | 'playing';
7
+ export type MediaSessionAction = 'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto' | 'stop';
8
8
  export interface MetadataOptions {
9
9
  album?: string;
10
10
  artist?: string;
@@ -17,7 +17,7 @@ export interface PlaybackStateOptions {
17
17
  export interface ActionHandlerOptions {
18
18
  action: MediaSessionAction;
19
19
  }
20
- export declare type ActionHandler = (details: ActionDetails) => void;
20
+ export type ActionHandler = (details: ActionDetails) => void;
21
21
  interface ActionDetails {
22
22
  action: MediaSessionAction;
23
23
  seekTime?: number | null;
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,WAAW,CAAC,OAAwB;QACxC,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;SAC5E;QAED,MAAM,iBAAiB,GAAI,MAAc,CAAC,aAAa,CAAC;QACxD,IAAI,iBAAiB,EAAE;YACrB,YAAY,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;SACxD;aAAM;YACL,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC;SACjC;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B;QAClD,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;SAC5E;QACD,YAAY,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B,EAAE,OAA6B;QACjF,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;SAC5E;QACD,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B;QAClD,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;SAC5E;QACD,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ActionHandler,\n ActionHandlerOptions,\n MediaSessionPlugin,\n MetadataOptions,\n PlaybackStateOptions,\n PositionStateOptions,\n} from './definitions';\n\nexport class MediaSessionWeb extends WebPlugin implements MediaSessionPlugin {\n async setMetadata(options: MetadataOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n\n const MediaMetadataCtor = (window as any).MediaMetadata;\n if (MediaMetadataCtor) {\n mediaSession.metadata = new MediaMetadataCtor(options);\n } else {\n mediaSession.metadata = options;\n }\n }\n\n async setPlaybackState(options: PlaybackStateOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.playbackState = options.playbackState;\n }\n\n async setActionHandler(options: ActionHandlerOptions, handler: ActionHandler | null): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.setActionHandler(options.action, handler);\n }\n\n async setPositionState(options: PositionStateOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.setPositionState(options);\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,OAAO,eAAgB,SAAQ,SAAS;IAC5C,KAAK,CAAC,WAAW,CAAC,OAAwB;QACxC,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;QAC7E,CAAC;QAED,MAAM,iBAAiB,GAAI,MAAc,CAAC,aAAa,CAAC;QACxD,IAAI,iBAAiB,EAAE,CAAC;YACtB,YAAY,CAAC,QAAQ,GAAG,IAAI,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACzD,CAAC;aAAM,CAAC;YACN,YAAY,CAAC,QAAQ,GAAG,OAAO,CAAC;QAClC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B;QAClD,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;QAC7E,CAAC;QACD,YAAY,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B,EAAE,OAA6B;QACjF,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;QAC7E,CAAC;QACD,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA6B;QAClD,MAAM,YAAY,GAAI,SAAiB,CAAC,YAAY,CAAC;QACrD,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,CAAC,WAAW,CAAC,kDAAkD,CAAC,CAAC;QAC7E,CAAC;QACD,YAAY,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IAED,KAAK,CAAC,gBAAgB;QACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;CACF","sourcesContent":["import { WebPlugin } from '@capacitor/core';\n\nimport type {\n ActionHandler,\n ActionHandlerOptions,\n MediaSessionPlugin,\n MetadataOptions,\n PlaybackStateOptions,\n PositionStateOptions,\n} from './definitions';\n\nexport class MediaSessionWeb extends WebPlugin implements MediaSessionPlugin {\n async setMetadata(options: MetadataOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n\n const MediaMetadataCtor = (window as any).MediaMetadata;\n if (MediaMetadataCtor) {\n mediaSession.metadata = new MediaMetadataCtor(options);\n } else {\n mediaSession.metadata = options;\n }\n }\n\n async setPlaybackState(options: PlaybackStateOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.playbackState = options.playbackState;\n }\n\n async setActionHandler(options: ActionHandlerOptions, handler: ActionHandler | null): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.setActionHandler(options.action, handler);\n }\n\n async setPositionState(options: PositionStateOptions): Promise<void> {\n const mediaSession = (navigator as any).mediaSession;\n if (!mediaSession) {\n throw this.unavailable('Media Session API not available in this browser.');\n }\n mediaSession.setPositionState(options);\n }\n\n async getPluginVersion(): Promise<{ version: string }> {\n return { version: 'web' };\n }\n}\n"]}
@@ -4,7 +4,7 @@ import MediaPlayer
4
4
 
5
5
  @objc(MediaSessionPlugin)
6
6
  public class MediaSessionPlugin: CAPPlugin, CAPBridgedPlugin {
7
- private let pluginVersion: String = "7.2.9"
7
+ private let pluginVersion: String = "8.0.2"
8
8
  public let identifier = "MediaSessionPlugin"
9
9
  public let jsName = "MediaSession"
10
10
  public let pluginMethods: [CAPPluginMethod] = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-media-session",
3
- "version": "7.2.9",
3
+ "version": "8.0.2",
4
4
  "description": "Capacitor plugin to expose media session controls of the device",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
@@ -24,6 +24,7 @@
24
24
  "bugs": {
25
25
  "url": "https://github.com/Cap-go/capacitor-media-session/issues"
26
26
  },
27
+ "homepage": "https://capgo.app/docs/plugins/media-session/",
27
28
  "keywords": [
28
29
  "capacitor",
29
30
  "plugin",
@@ -49,23 +50,25 @@
49
50
  "prepublishOnly": "npm run build"
50
51
  },
51
52
  "devDependencies": {
52
- "@capacitor/android": "^7.0.0",
53
- "@capacitor/core": "^7.0.0",
54
- "@capacitor/docgen": "^0.3.0",
55
- "@capacitor/ios": "^7.0.0",
53
+ "@capacitor/android": "^8.0.0",
54
+ "@capacitor/core": "^8.0.0",
55
+ "@capacitor/docgen": "^0.3.1",
56
+ "@capacitor/ios": "^8.0.0",
56
57
  "@ionic/eslint-config": "^0.4.0",
57
58
  "@ionic/prettier-config": "^4.0.0",
58
59
  "@ionic/swiftlint-config": "^2.0.0",
59
- "eslint": "^8.57.0",
60
- "prettier": "^3.4.2",
61
- "prettier-plugin-java": "^2.6.6",
62
- "rimraf": "^6.0.1",
63
- "rollup": "^4.30.1",
60
+ "@types/node": "^24.10.1",
61
+ "eslint": "^8.57.1",
62
+ "eslint-plugin-import": "^2.31.0",
63
+ "prettier": "^3.6.2",
64
+ "prettier-plugin-java": "^2.7.7",
65
+ "rimraf": "^6.1.0",
66
+ "rollup": "^4.53.2",
64
67
  "swiftlint": "^2.0.0",
65
- "typescript": "~4.1.5"
68
+ "typescript": "^5.9.3"
66
69
  },
67
70
  "peerDependencies": {
68
- "@capacitor/core": ">=7.0.0"
71
+ "@capacitor/core": ">=8.0.0"
69
72
  },
70
73
  "prettier": "@ionic/prettier-config",
71
74
  "swiftlint": "@ionic/swiftlint-config",