brightcove not showing when rendered (not page refresh - plain Backbone.js
View re-render)
TLDR; The video player doesn't show on re-render (Backbone View)
Is there some global state brightcove keeps?
I'm using backbone.js and rendering the page using a backbone View with
this jst.ejs template. It works perfectly the first time around. But if I
navigate to next page and then back, it doesn't show anymore.
<script language="JavaScript" type="text/javascript"
src="http://admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<script>
window.BCVideo = BCVideoFunction(); //BCVideoFunction as module pattern.
</script>
<object id="bc_experience" class="BrightcoveExperience">
<param name="includeAPI" value="true" />
<param name="templateLoadHandler" value="BCVideo.onTemplateLoad" />
<param name="templateReadyHandler" value="BCVideo.onTemplateReady" />
<param name="bgcolor" value="#FFFFFF" />
<param name="width" value="100%" />
<param name="height" value="100%" />
<param name="playerID" value="1426444499001" />
<param name="playerKey"
value="AQ~~,AAABTAHETAE~,G1RKcv5og48msI78DncnAb9MEySkUi_b" />
<param name="isVid" value="true" />
<param name="isUI" value="true" />
<param name="wmode" value="transparent"/>
<param name="dynamicStreaming" value="true" />
<param name="wmode" value="transparent"/>
<param name="@videoPlayer" value="<%= variables.video_id %>" />
</object>
after rerender (second visit), I can see the object exists
> window.bc_experience `
<object type=​"application/​x-shockwave-flash"
data=​"http:​/​/​c.brightcove.com ...
# window.bc_experience.remove() doesn't help
Removing it from the dom doesn't help.
Hitting BCVideo.play will log 'play video' (my code, calling
videoPlayer.play() as in the examples) as many times as I navigated to
(rerendered) that view.
> BCVideo.play()
playing video
playing video
playing video
Obviously it's live an kicking... Am I missing something obvious? Thanks
for helping!
The brightcove video is loaded and running perfectly on first load.
No comments:
Post a Comment