Skip to main content

When publishing a video, the advanced option provides a snippet along the lines of this:

<script src="https://players.brightcove.net/ACCOUNT_ID/PLAYER_ID_default/index.min.js"></script>

 

Does this support the “async”  attribute? If so - Can that be the noted in the embed code? This would greatly help on page load performance.

 

Hi, Tim,

 

Thanks for bringing this interesting question to our attention.

 

We will need to investigate a little more to provide the correct details with you and probably an example. Can you help me open a ticket with our support team, please? We must review with our Players Team so a ticket is the best option here.

 

You can open it by sending an email with the details to bc_support@brightcove.com


Thanks for your cooperation, and have a great weekend.


(for future folks curious on status) Tracking as Case Number: 01523058


I know that there was a Brightcove Player loader on Github that would load async, but not sure if it is still active:

 

https://github.com/brightcove/player-loader


Here’s the answer: Yes

 

Reply from the engineering team per my open case:

The engineering team has confirmed that you can indeed add the "async" attribute to the JavaScript line in the embed code.

 

We’ll test this internally first to confirm and regression check our additional customizations


On further review, if you want an additional performance boost.  I discovered we did something similar in concept. The `$` assumes jQuery is loaded. 


 

$.getScript("//players.brightcove.net/ACCOUNT_ID/PLAYER_ID_default/index.min.js" , function() {

    // Run Additional code after script was loaded to decorate the player

});

 

So by using getScript - The library loading can be deferred even longer for interactive events to prove interaction with the page such as scrolling. (Especially when the video is not in the viewable area on load)


Reply