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

benrr101 / node-taglib-sharp / 48257345

12 Oct 2023 04:06AM UTC coverage: 92.315% (+0.4%) from 91.944%
48257345

push

appveyor

benrr101
Performer roles (bug fixed), genres

3226 of 4153 branches covered (0.0%)

Branch coverage included in aggregate %.

94 of 94 new or added lines in 2 files covered. (100.0%)

27069 of 28664 relevant lines covered (94.44%)

417.21 hits per line

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

70.0
/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 {Mpeg4BoxClassType} from "../mpeg4BoxClassType";
1✔
8
import {Guards} from "../../utils";
1✔
9

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

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

34
        return instance;
×
35
    }
36

37
    /**
38
     * Constructs and initializes a new instance of @see IsoMetaBox with a specified handler.
39
     * @param handlerType A @see ByteVector object specifying a 4 byte handler type.
40
     * @param handlerName A @see string object specifying the handler name.
41
     * @returns A new instance of @see IsoMetaBox
42
     */
43
    public static fromHandler(handlerType: ByteVector, handlerName?: string): IsoMetaBox {
44
        Guards.notNullOrUndefined(handlerType, "handlerType");
105✔
45

46
        if (handlerType.length < 4) {
105!
47
            throw new Error("The handler type must be four bytes long.");
×
48
        }
49

50
        const instance = new IsoMetaBox();
105✔
51
        instance.initializeFromTypeVersionAndFlags(Mpeg4BoxType.META, 0, 0);
105✔
52
        instance.addChild(IsoHandlerBox.fromHandlerTypeAndHandlerName(handlerType, handlerName));
105✔
53

54
        return instance;
105✔
55
    }
56

57
    /** @inheritDoc */
58
    public get boxClassType(): Mpeg4BoxClassType { return Mpeg4BoxClassType.IsoMetaBox; }
×
59
}
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