mediaelement / mediaelement-plugins

Plugins for the main mediaelement project
405 stars 137 forks source link

Getting error with speed feature #116

Closed sametaylak closed 1 year ago

sametaylak commented 6 years ago
<link href="{{ URL::asset('mediaelement/build/mediaelementplayer.min.css') }}" rel="stylesheet">
<link href="{{ URL::asset('mediaelement/plugins/dist/speed/speed.css') }}" rel="stylesheet">
<!-- BODY -->
<script src="{{ URL::asset('mediaelement/build/mediaelement-and-player.js') }}"></script>
<script src="{{ URL::asset('mediaelement/plugins/dist/speed/speed.js') }}"></script>
<script src="{{ URL::asset('mediaelement/plugins/dist/speed/speed-i18n.js') }}"></script>
<script type="text/javascript">
        var player = new MediaElementPlayer('watchill-video-player', {
          features: ['playpause','loop','progress','current','duration','speed','volume','fullscreen'],
          pluginPath: "{{ URL::asset('mediaelement/plugins/dist') }}/",          
          shimScriptAccess: 'always',
          success: function(mediaElement, originalNode) {

          }
        });
</script>

Hello, i'm using mediaelementplayer for my laravel project. As you can see i included every files. But there is no speedButton in controls bar. I am trying to manually build features in console panel and i got some error messages.

player.buildfeatures();
mediaelement-and-player.js:4818 error building playpause TypeError: Cannot read property 'parentNode' of undefined
    at MediaElementPlayer.addControlElement (mediaelement-and-player.js:4656)
    at MediaElementPlayer.buildplaypause (mediaelement-and-player.js:1495)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building progress TypeError: Cannot read property 'options' of undefined
    at MediaElementPlayer.buildprogress (mediaelement-and-player.js:1581)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building current TypeError: Cannot read property 'options' of undefined
    at MediaElementPlayer.buildcurrent (mediaelement-and-player.js:2112)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building duration TypeError: Cannot read property 'lastChild' of undefined
    at MediaElementPlayer.buildduration (mediaelement-and-player.js:2128)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building speed TypeError: Cannot set property 'speedButton' of undefined
    at MediaElementPlayer.buildspeed (speed.js:81)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building volume TypeError: Cannot read property 'getElement' of undefined
    at MediaElementPlayer.buildvolume (mediaelement-and-player.js:3186)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
buildfeatures @ mediaelement-and-player.js:4818
(anonymous) @ VM9657:1
mediaelement-and-player.js:4818 error building fullscreen TypeError: Cannot read property 'isVideo' of undefined
    at MediaElementPlayer.buildfullscreen (mediaelement-and-player.js:1206)
    at MediaElementPlayer.buildfeatures (mediaelement-and-player.js:4816)
    at <anonymous>:1:8
sametaylak commented 6 years ago

i debugged speed.js file and i noticed buildspeed function doesn't call

sametaylak commented 6 years ago
key: 'buildfeatures',
        value: function buildfeatures(player, controls, layers, media) {
            var t = this;

            for (var i = 0, total = t.options.features.length; i < total; i++) {
                var feature = t.options.features[i];
                if (t['build' + feature]) {
                    try {
                        t['build' + feature](player, controls, layers, media);
                    } catch (e) {
                        console.error('error building ' + feature, e);
                    }
                }
            }
        }

in this code block it should be call buildspeed function but it seems it doesnt