@ngxsp/core 0.2.2 → 0.3.1-next.555

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.
@@ -6,20 +6,39 @@
6
6
  export declare const MEDIA_LIBRARY_MODEL_VERSION = 3;
7
7
  export type MediaLibraryKind = 'audio' | 'video';
8
8
  export type AudioInferredField = 'title' | 'artist' | 'albumArtist' | 'album' | 'trackNo';
9
- /** The subset of music-metadata results the model reads. */
9
+ /**
10
+ * The subset of music-metadata results the model reads, in both spellings on purpose.
11
+ *
12
+ * music-metadata 13 camel-cased the common tag properties: 71 of its 124 keys were renamed, four of
13
+ * them ones read here — `albumartist` became `albumArtist`, `genre` became `genres`, and the
14
+ * `track`/`disk` objects became the plain numbers `trackNumber`/`discNumber`. These fields are
15
+ * redeclared rather than imported, so nothing type-checks against the package and a renamed tag is
16
+ * not an error anywhere: it reads as `undefined`, and the library quietly loses the album artist,
17
+ * the genre and the track order while every test stays green.
18
+ *
19
+ * Reading both spellings keeps either version usable, which is what the apps need — each one ships
20
+ * its own copy of music-metadata, and they do not move at the same time.
21
+ */
10
22
  export interface MediaTags {
11
23
  title?: string;
12
24
  artist?: string;
13
25
  artists?: string[];
26
+ /** `albumartist` up to music-metadata 12, `albumArtist` from 13. */
14
27
  albumartist?: string;
28
+ albumArtist?: string;
15
29
  album?: string;
30
+ /** `genre` up to music-metadata 12, `genres` from 13. */
16
31
  genre?: string | string[];
32
+ genres?: string[];
33
+ /** An object up to music-metadata 12, a plain number from 13. */
17
34
  track?: {
18
35
  no?: number | null;
19
36
  };
37
+ trackNumber?: number;
20
38
  disk?: {
21
39
  no?: number | null;
22
40
  };
41
+ discNumber?: number;
23
42
  year?: number;
24
43
  stik?: number;
25
44
  tvShow?: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * What a share button puts on the clipboard, when the media has an address worth handing to
3
+ * someone else.
4
+ *
5
+ * The video player learnt this the hard way: it used to copy `location.href` — the address of the
6
+ * window doing the sharing, `file://` in the packaged application and a localhost port in the
7
+ * browser. That link led back to the sharer's own screen and nowhere for anybody else.
8
+ */
9
+ /**
10
+ * The media's own address when it travels, and nothing when it does not. Only absolute http and
11
+ * https do: a relative address is read against the window it was copied from, a file on the disk
12
+ * and an application's own scheme name a place on this machine, and a loopback address names the
13
+ * reader's.
14
+ */
15
+ export declare function shareableSourceUrl(source: string | undefined | null): string | null;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A count and the word that agrees with it.
3
+ *
4
+ * The applications used to write "(s)" — "1 titre(s)" — or to pick the plural above one, which is
5
+ * right in French and wrong in English: French keeps the singular at zero ("0 titre"), English does
6
+ * not ("0 tracks"). One rule, so neither application has to remember which.
7
+ */
8
+ /** The word that agrees with a count, in the locale's own rule. */
9
+ export declare function pluralWord(locale: string, count: number, singular: string, plural: string): string;
10
+ /** A count and the word that agrees with it: "1 titre", "3 titres", "0 tracks". */
11
+ export declare function countLabel(locale: string, count: number, singular: string, plural: string): string;
@@ -0,0 +1 @@
1
+ export declare function isSupersededLoad(error: unknown): boolean;
@@ -17,12 +17,6 @@ export interface RemotePlaybackEngineOptions {
17
17
  /** Above the native (0) and adaptive engines, so a session takes every source. */
18
18
  priority?: number;
19
19
  }
20
- /**
21
- * Plays through a remote device (DLNA renderer, Cast device) with the player's own controls. Like a media element,
22
- * loading prepares the media and playing starts it: the device receives it on the first `play`, from the position
23
- * reached until then. The device's position and state come back by polling. A device that refuses a media gets it
24
- * converted when the app can convert it; a converted stream seeks by starting again from the new position.
25
- */
26
20
  export declare function createRemotePlaybackEngineFactory(options: RemotePlaybackEngineOptions): EngineFactory;
27
21
  export declare class RemotePlaybackEngine implements PlaybackEngine {
28
22
  private readonly options;
@@ -24,6 +24,16 @@ export declare class PlayerFacade {
24
24
  private engineFactories;
25
25
  private engineId;
26
26
  private lastNonFatal;
27
+ /**
28
+ * Which load has already had its failure reported.
29
+ *
30
+ * One unreadable file used to be reported three times over, by three doors: the media element's
31
+ * own error event, the rejection of `play()`, and the engine's error event. Three codes, three
32
+ * messages, nothing a host could tell apart from three broken files — so a listener was told
33
+ * three times, and a host that moves on after a failure heard three reasons to move.
34
+ */
35
+ private failureReportedForLoad;
36
+ private loadCount;
27
37
  private mediaDecodingSub;
28
38
  private video?;
29
39
  private engine?;