2

I'm new to clojurescript/reagent and am testing out ideas for a media display app. At the moment I'm having problems with a few more specific elements of including html5 media components on my page and using their full features.

Example - including #t=10,10 at the end of a video source string(referenced here https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Using_HTML5_audio_and_video) will sometimes work but only take the end range value. Same video element - using any attributes that aren't true/false will break compilation. e.g :preload auto doesn't work whereas :fullscreen false does.

Is there a clojurescript way to handle these elements or is this more js interop territory?

txesc
  • 21
  • 3

1 Answers1

1

Since clojurescript will be compiled to JS eventually. Everything JS can do..clojurescript could do it equally well.

your "sometime work" issues are related to the nature of ReactJS ( Reagent is a wrapper of ReactJS ). Generally, you need to obtain the dom node of video tag to use most of the video tag's features.

Related issues

Video displayed in ReactJS component not updating

Example

Source Code Example of how to interact with video tag under ReactJS.

https://github.com/eisneim/react-html5-video/blob/master/src/Video.js

You should provide the minimum case to produce the problem, so others could help you.

Community
  • 1
  • 1
ka yu Lai
  • 571
  • 3
  • 13
  • Thanks for your answer and resources. My simple example would be something like this - [:video {:width 200 :height 200 :src "video/video.mp4#t=15,60" :start:autoplay true :controls true :loop false :preload "auto" :fullscreen false }]. The #t= form at the end of should play a section of the video. However, that is the part that only works sometimes. Even when outside of a reagent component. – txesc Aug 27 '16 at 12:24
  • How would I be able to obtain the dom node? – txesc Sep 23 '16 at 00:36
  • the last two steps showing you how to get the dom https://github.com/reagent-project/reagent-cookbook/blob/master/recipes/draggable/README.md – ka yu Lai Oct 10 '16 at 10:16