<commit_before>/* global DPLAYER_VERSION */
import defaultApiBackend from './api.js';

export default (options) => {

    // default options
    const defaultOption = {
        container: options.element || document.getElementsByClassName('dplayer')[0],
        live: false,
        autoplay: false,
        theme: '#b7daff',
        loop: false,
        lang: (navigator.language || navigator.browserLanguage).toLowerCase(),
        screenshot: false,
        hotkey: true,
        preload: 'auto',
        volume: 0.7,
        apiBackend: defaultApiBackend,
        video: {},
        contextmenu: [],
        mutex: true
    };
    for (const defaultKey in defaultOption) {
        if (defaultOption.hasOwnProperty(defaultKey) && !options.hasOwnProperty(defaultKey)) {
            options[defaultKey] = defaultOption[defaultKey];<commit_msg>change default preload to metadata<commit_after>/* global DPLAYER_VERSION */
import defaultApiBackend from './api.js';

export default (options) => {

    // default options
    const defaultOption = {
        container: options.element || document.getElementsByClassName('dplayer')[0],
        live: false,
        autoplay: false,
        theme: '#b7daff',
        loop: false,
        lang: (navigator.language || navigator.browserLanguage).toLowerCase(),
        screenshot: false,
        hotkey: true,
        preload: 'metadata',
        volume: 0.7,
        apiBackend: defaultApiBackend,
        video: {},
        contextmenu: [],
        mutex: true
    };
    for (const defaultKey in defaultOption) {
        if (defaultOption.hasOwnProperty(defaultKey) && !options.hasOwnProperty(defaultKey)) {
            options[defaultKey] = defaultOption[defaultKey];
{'fraction_non_alphanumeric': 0.11792177466433158, 'fraction_numerical': 0.004670169293636894, 'mean_word_length': 2.670235546038544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1257166', 'n_tokens_mistral': 462, 'n_tokens_neox': 471, 'n_words': 107}