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

benrr101 / node-taglib-sharp / 48389640

28 Oct 2023 06:22PM UTC coverage: 92.443% (+0.5%) from 91.9%
48389640

push

appveyor

web-flow
MPEG4 Cleanup (#88)

* Round one

* Round 2

* Fixing up mpeg4box file

* Fix names of box types to match style

* Fix names of box types to match style

* Separate boxes into separate files ... not working yet.

* Decomposing handler type to a bytevector. This is clumsy but will be cleaned up shortly

* Moving rendering to a utility class. Fixes cyclic dependencies

* Adding stuff to index and moving things around to let tests run

* Fixing iso handler box that was broken

* Public fields to properties

* Removing redundant variable typing

* Removing redundant casts

* Removing child factory from isoAudioSampleEntry.ts

* Removing child factory from appleAnnotationBox.ts

* Removing child factory from appleItemListBox.ts and isoMetaBox.ts

* Removing child factory from isoSampleDescriptionBox.ts

* Removing child factory from isoSampleTableBox.ts and isoUserDataBox.ts

* Child factories have been outlawed

* Introduce a handler type class

* Simplify the mpeg4boxtype class

* handler types in a different class

* Rewrite the get* methods

* Some tests

* Single itunes tag tests

* Performer roles (bug fixed), genres

* 99% coverage of appletag

* Pretty much the last cleanup I want to do before another release cycle.

* Leaving a todo

* Ok two more tweaks

3250 of 4147 branches covered (0.0%)

Branch coverage included in aggregate %.

1763 of 1763 new or added lines in 39 files covered. (100.0%)

26757 of 28313 relevant lines covered (94.5%)

422.43 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 @see 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 @see IsoMetaBox with a provided header and
22
     * handler by reading the contents from a specified file.
23
     * @param file A @see File object to read the contents of the box from.
24
     *     new instance, or undefined if no handler applies.
25
     * @param header A @see 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
     * @returns A new instance of @see IsoMetaBox
28
     */
29
    public static fromFile(file: File, header: Mpeg4BoxHeader, handlerType: ByteVector): IsoMetaBox {
30
        const instance = new IsoMetaBox();
×
31
        instance.initializeFromHeaderFileAndHandler(header, file, handlerType);
×
32

33
        return instance;
×
34
    }
35

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

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

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

54
        return instance;
113✔
55
    }
56
}
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