• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

benrr101 / node-taglib-sharp / 48391045

29 Oct 2023 04:39AM UTC coverage: 92.535% (-1.4%) from 93.934%
48391045

push

appveyor

benrr101
Merge branch 'release/v5.2.0'

3244 of 4129 branches covered (0.0%)

Branch coverage included in aggregate %.

2177 of 2177 new or added lines in 61 files covered. (100.0%)

26728 of 28261 relevant lines covered (94.58%)

423.2 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.68
/src/mpeg4/boxes/isoMetaBox.ts
1
import FullBox from "./fullBox";
1✔
2
import IsoHandlerBox from "./isoHandlerBox";
1✔
3
import Mpeg4BoxHeader from "../mpeg4BoxHeader";
4
import Mpeg4BoxType from "../mpeg4BoxType";
1✔
5
import {ByteVector} from "../../byteVector";
6
import {File} from "../../file";
7
import {Guards} from "../../utils";
1✔
8

9
/**
10
 * This class extends {@link FullBox} to provide an implementation of a ISO/IEC 14496-12 MetaBox.
11
 */
12
export default class IsoMetaBox extends FullBox {
1✔
13
    /**
14
     * Private constructor to force construction via static functions.
15
     */
16
    private constructor() {
17
        super();
113✔
18
    }
19

20
    /**
21
     * Constructs and initializes a new instance of {@link IsoMetaBox} with a provided header and
22
     * handler by reading the contents from a specified file.
23
     * @param file A {@link File} object to read the contents of the box from.
24
     *     new instance, or undefined if no handler applies.
25
     * @param header A {@link Mpeg4BoxHeader} object containing the header to use for the new instance.
26
     * @param handlerType Type of the handler box object containing the handler that applies to the
27
     */
28
    public static fromFile(file: File, header: Mpeg4BoxHeader, handlerType: ByteVector): IsoMetaBox {
29
        const instance = new IsoMetaBox();
×
30
        instance.initializeFromHeaderFileAndHandler(header, file, handlerType);
×
31

32
        return instance;
×
33
    }
34

35
    /**
36
     * Constructs and initializes a new instance of {@link IsoMetaBox} with a specified handler.
37
     * @param handlerType A {@link ByteVector} object specifying a 4 byte handler type.
38
     * @param handlerName A `string` object specifying the handler name.
39
     */
40
    public static fromHandler(handlerType: ByteVector, handlerName?: string): IsoMetaBox {
41
        Guards.truthy(handlerType, "handlerType");
113✔
42
        if (handlerType.length < 4) {
113!
43
            throw new Error("The handler type must be four bytes long.");
×
44
        }
45

46
        const instance = new IsoMetaBox();
113✔
47
        instance.initializeFromTypeVersionAndFlags(Mpeg4BoxType.META, 0, 0);
113✔
48

49
        const handlerBox = IsoHandlerBox.fromHandlerTypeAndHandlerName(handlerType, handlerName);
113✔
50
        instance.addChild(handlerBox);
113✔
51

52
        return instance;
113✔
53
    }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc