如何更改属性的值?

时间:2015-04-16 10:36:03

标签: javascript

我需要在此代码中更改vastAdTagUrl的值/内容: 它需要是我可以调用的函数。我知道这听起来很容易,而且可能是,但我无法让它发挥作用......

<script id="player1">
    var mediaEventNames = 'loadstart progress suspend abort error emptied stalled play pause loadedmetadata loadeddatawaiting playing canplay canplaythrough seeking seeked timeupdate ended ratechange durationchange volumechange'.split(' ');
    $('video').mediaelementplayer({
    pluginPath: '../build/',
    vastAdTagUrl: 'http://ab166247.adbutler-meson.com/vast.spark?setID=1260&ID=166247&pid=17922',

    vastEnableSkip: true,
    vastSkipSeconds: 3,
    features: ['playpause','current','progress','duration','volume','fullscreen','vast'],

    success: function(media, node, player) {
        for (var i=0; i<mediaEventNames.length; i++) {
            (function(eventName) {
                media.addEventListener(eventName, function(e) {
                    console.log('event', eventName);
                });
            })(mediaEventNames[i]);
        }     
    }
}); 
</script>

我发现它很难,因为它不是一个普通的变量而不是只能通过ID到达的东西。我感谢所有帮助。

0 个答案:

没有答案