<commit_before>import HTML5Video from 'playbacks/html5_video'

describe('HTML5Video playback', () => {
  it('checks if it can play a resource', () => {
    expect(HTML5Video.canPlay("")).to.be.false
    expect(HTML5Video.canPlay("resource_without_dots")).to.be.false
    expect(HTML5Video.canPlay("http://domain.com/video.ogv")).to.be.true
    expect(HTML5Video.canPlay("http://domain.com/video.ogv?query_string=here")).to.be.true
    expect(HTML5Video.canPlay("/relative/video.ogv")).to.be.true
  })

  it('checks if it can play a resource with mime-type', () => {
    expect(HTML5Video.canPlay("resource_without_dots", 'video/mp4;"codecs=mp4v.20.8,mp4a.40.2"')).to.be.true
  })

  it('does set a valid src to video element', () => {
    var options = {src: 'http://example.com/dash.mp4'}
    var playback = new HTML5Video(options)

    expect(playback.src).to.be.equals('http://example.com/dash.mp4')
  })

  it('does not set an invalid src to video element', () => {
    // although clappr can play dash.mpd it uses MSE, this is done to avoid to create source tag with invalid src
    var options = {src: 'http://example.com/dash.mpd'}
    var playback = new HTML5Video(options)

    expect(playback.src).to.be.equals(undefined)
  })
})<commit_msg>test: uses a common used codec<commit_after>import HTML5Video from 'playbacks/html5_video'

describe('HTML5Video playback', () => {
  it('checks if it can play a resource', () => {
    expect(HTML5Video.canPlay("")).to.be.false
    expect(HTML5Video.canPlay("resource_without_dots")).to.be.false
    expect(HTML5Video.canPlay("http://domain.com/video.ogv")).to.be.true
    expect(HTML5Video.canPlay("http://domain.com/video.ogv?query_string=here")).to.be.true
    expect(HTML5Video.canPlay("/relative/video.ogv")).to.be.true
  })

  it('checks if it can play a resource with mime-type', () => {
    expect(HTML5Video.canPlay("resource_without_dots", 'video/ogg; codecs="theora, vorbis"')).to.be.true
  })

  it('does set a valid src to video element', () => {
    var options = {src: 'http://example.com/dash.ogg'}
    var playback = new HTML5Video(options)

    expect(playback.src).to.be.equals('http://example.com/dash.ogg')
  })

  it('does not set an invalid src to video element', () => {
    // although clappr can play dash.mpd it uses MSE, this is done to avoid to create source tag with invalid src
    var options = {src: 'http://example.com/dash.mpd'}
    var playback = new HTML5Video(options)

    expect(playback.src).to.be.equals(undefined)
  })
})
{'fraction_non_alphanumeric': 0.1658051689860835, 'fraction_numerical': 0.013121272365805169, 'mean_word_length': 3.952755905511811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3849542', 'n_tokens_mistral': 875, 'n_tokens_neox': 852, 'n_words': 175}