Embedding video in treesaver

102 views
Skip to first unread message

Mark Kessler

unread,
Mar 3, 2013, 12:55:12 PM3/3/13
to trees...@googlegroups.com
Please help me with a problem I have embedding a video in a Treesave article. I am trying to embed the video using the "Flowplayer" framework (http://flowplayer.org/). The problem I have with this is understanding where exactly the DOM of what is shown to the user is located. I tried several ways to embed the video with Flowplayer. The approach that worked best was to initialize the player directly after the html of the player is rendered:

<div class="player" data-swf="flowplayer/flowplayer.swf" data-ratio="0.417">
 <video>
   <source type="video/mp4" src="/upload/content_field_values/325/624x260_original.mp4"/>
 </video>
</div>
<script>
$(".player").flowplayer({debug: true, native_fullscreen: true, tooltip: false, splash: false});
</script>

this works to a certain amount but the movie never plays because when the "ready" event is fired, Flowplayer tries to initialize the movie by the initial reference given to it which was $('player'). But this reference does not anymore contain the reference to the DOM that is actually displayed because any changes made to this DOM are not reflected in what the user sees.

I do not know the inner workings of the Treesaver framework enough to understand what is going on here. However, on another thread I found this recommendation by Andrea Campi:
* also, do not generally assume that content is attached to the document;
* in general, *do not* manipulate the document DOM; instead use the Treesaver objects that you receive from the event handlers.
This might be the key. When I couple the movie initialization with a Treesaver event and operate with the proper DOM reference given from that object. But i do not understand how exactly I can put this recommendation into use. I tried this.

treesaver.addListener(document, 'treesaver.articlechanged', function (event) {
  $(event.srcElement).find('.player').flowplayer({debug: true, native_fullscreen: true, tooltip: false, splash: false});
}); 

but this doesn't work. I wonder if I am on the right trace? Please can you help me with this? I tried the whole day today but without a solution.

Regards,
Mark Kessler
 

Mark Kessler

unread,
Mar 4, 2013, 5:53:15 PM3/4/13
to trees...@googlegroups.com
Please, can you point me in the right direction?

Darren Ramowski

unread,
Apr 20, 2013, 8:53:54 AM4/20/13
to trees...@googlegroups.com
Are you trying to get working inline? I've managed to get working fairly well using the lightbox solution with reference to another page which specifically handles the video playing via jwplayer.

Regards, Darren

Mark Kessler

unread,
Apr 22, 2013, 4:21:30 AM4/22/13
to trees...@googlegroups.com
Yes I tried to get it to work offline. But the lightbox solution is also an option so I might try that. 
Thank you!

On Sat, Apr 20, 2013 at 2:53 PM, Darren Ramowski <darren....@gmail.com> wrote:
Are you trying to get working inline?  I've managed to get working fairly well using the lightbox solution with reference to another page which specifically handles the video playing via jwplayer.

Regards, Darren

--
You received this message because you are subscribed to the Google Groups "Treesaver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to treesaverjs...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Darren Ramowski

unread,
Apr 22, 2013, 4:30:56 AM4/22/13
to trees...@googlegroups.com
Lightbox works well.  

I hadn't actually thought about the offline use, so can now see why you would want to load within the page.  Let me know if you solve it.

Regards, Darren

You received this message because you are subscribed to a topic in the Google Groups "Treesaver" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/treesaverjs/Od16vaI5p7E/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to treesaverjs...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages