<commit_before>var USE_MEDIASOURCE_API = false;

var NetStreamDefinition = (function () {
  return {
    // (connection:NetConnection, peerID:String = "connectToFMS")
    __class__: "flash.net.NetStream",
    initialize: function () {
    },
    __glue__: {
      script: {
        instance: scriptProperties("public", ["appendBytes",
                                              "appendBytesAction"])
      },
      native: {
        static: {
        },
        instance: {
          ctor: function ctor(connection, peerID) {
            // (connection:NetConnection, peerID:String) -> void
            somewhatImplemented("NetStream.ctor");
            this._contentTypeHint = null;
            this._mediaSource = null;
            this._urlReady = new Promise();
          },
          onResult: function onResult(streamId) {
            // (streamId:int) -> void
            notImplemented("NetStream.onResult");
          },
          dispose: function dispose() {
            // (void) -> void
            notImplemented("NetStream.dispose");
          },
          play: function play(url) {
            // (void) -> void
            if (!USE_MEDIASOURCE_API) {
              this._urlReady.resolve(url);
              somewhatImplemented("NetStream.play");
              return;
            }

            var mediaSource = new MediaSource();
            mediaSource.addEventListener('sourceopen', function(e) {
              this._mediaSource = mediaSource;
            }.bind(this));
            mediaSource.addEventListener('sourceend', function(e) {
              this._mediaSource = null;<commit_msg>Enables MediaSource API playback by default<commit_after>var USE_MEDIASOURCE_API = true;

var NetStreamDefinition = (function () {
  return {
    // (connection:NetConnection, peerID:String = "connectToFMS")
    __class__: "flash.net.NetStream",
    initialize: function () {
    },
    __glue__: {
      script: {
        instance: scriptProperties("public", ["appendBytes",
                                              "appendBytesAction"])
      },
      native: {
        static: {
        },
        instance: {
          ctor: function ctor(connection, peerID) {
            // (connection:NetConnection, peerID:String) -> void
            somewhatImplemented("NetStream.ctor");
            this._contentTypeHint = null;
            this._mediaSource = null;
            this._urlReady = new Promise();
          },
          onResult: function onResult(streamId) {
            // (streamId:int) -> void
            notImplemented("NetStream.onResult");
          },
          dispose: function dispose() {
            // (void) -> void
            notImplemented("NetStream.dispose");
          },
          play: function play(url) {
            // (void) -> void
            var isMediaSourceEnabled = USE_MEDIASOURCE_API;
            if (isMediaSourceEnabled && typeof MediaSource === 'undefined') {
              console.warn('MediaSource API is not enabled, falling back to regular playback');
              isMediaSourceEnabled = false;
            }
            if (!isMediaSourceEnabled) {
              this._urlReady.resolve(FileLoadingService.resolveUrl(url));
              somewhatImplemented("NetStream.play");
              return;
            }

            var mediaSource = new MediaSource();
            mediaSource.addEventListener('sourceopen', function(e) {
              this._mediaSource = mediaSource;
            }.bind(this));
            mediaSource.addEventListener('sourceend', function(e) {
              this._mediaSource = null;
{'fraction_non_alphanumeric': 0.11241283124128312, 'fraction_numerical': 0.0, 'mean_word_length': 1.77984496124031, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3798676', 'n_tokens_mistral': 892, 'n_tokens_neox': 884, 'n_words': 170}