Opened 8 years ago

Closed 8 years ago

File path - local files

Reported by: Owned by: anonymous lcordier normal MovieMacro normal 0.11

Description

Hi

I just installed MovieMacro on Trac 11.4. The Macro works basically, I can refernce YouTube-Videos. But when I try to reference an FLV file directly, it does not work.

I tried it by uploading an flv to a public folder (which I can acces by browser). But when I use

[[Movie(http://my/websites/path/somefolder/mymovie.flv)]]


All I get is a black "box", and when I click on it, it offers to download the flv file. That is not exactly what I expected :-) What could I be doing wrong?

I checked out that ticket about local file paths. But I don't get why I would have to use the "htdocs://" path...besides, it did not work.

comment:1 Changed 8 years ago by anonymous

• Summary changed from Local File Playback to File path - local files

comment:2 Changed 8 years ago by anonymous

OK, me again. I got the path basically working using htdocs (I got something mixed up there). Anyway, I still have the problem that the movie is not displayed/played back, but when clicked it offers a download of the flv. Whats wrong there?

[[Movie(htdocs://site/mymovie.flv)]]


comment:3 Changed 8 years ago by lcordier

I have looked at my generated HTML and it does indeed generate an <A> tag. There is an accompanied JavaScript that binds the flowPlayer to the link. The only thing that makes sense for your described behavior is if you have JavaScript disabled, or some other piece of JavaScript caused exceptions. Since I cannot replicate your bug, you'll have to use a JavaScript debugger. I suggest FireBug, http://getfirebug.com/.

<script>
$(function() {$("a.flowplayer").flowembed("/projects/test/chrome/movie/swf/FlowPlayerDark.swf", {initialScale:'scale'});
});
</script>

<a class="flowplayer" style="width: 320px; border: none; clear: both; margin: 0 auto; display: block; height: 320px;" href="/projects/test/chrome/site/crazy.flv"><img src="/projects/test/chrome/movie/img/black.jpg" style="width: 320px; border: none; clear: both; margin: 0 auto; display: block; height: 320px;"/></a>


Alternatively you could view the source of your generated page and cut & paste the script and <A> tag into this ticket, I'll look to see if I see any obvious issues.

Regards, Louis.

comment:4 Changed 8 years ago by anonymous

<a class="flowplayer"
style="width: 320px; border: none; clear: none; margin: 0; display: block; height: 320px;"
href="/trac/chrome/site/mymovie.flv">
<img src="/trac/chrome/movie/img/black.jpg"
style="width: 320px; border: none; clear: none; margin: 0; display: block; height: 320px;"/>
</a>


comment:5 Changed 8 years ago by anonymous

It seems there is no such script node in the generated site. After using the search function looking for "flow" I only found 'class="flowplayer"' from within the <a> tag listed above.

How can it be that the script is not output?

comment:6 Changed 8 years ago by anonymous

It seems that the whole movies directory (containing js,swf,img) is available. I can access the "flow.embed.js" file by calling the url "http://mydomain/trac/chrome/movie/js/flow.embed.js". The problem is that the whole javascript stuff is not included into the generated html.

comment:7 Changed 8 years ago by anonymous

I included the following to my site template to see if anything would change:

 <!-- Test for flowplayer - DELETE ME -->
<script type="text/javascript" src="/trac/chrome/movie/js/flow.embed.js"></script>

<script type="text/javascript" src="/trac/chrome/movie/js/flashembed.min.js"></script>
<script type="text/javascript">
$(function() {$("a.flowplayer").flowembed("/trac/chrome/movie/swf/FlowPlayerDark.swf", {initialScale:'scale'});
});
</script>


Sadly, nothing has changed. Now I have the includes, the function, the stuff is accesible and i have the <a> tag...and it still does not work.

comment:8 Changed 8 years ago by lcordier

It seems I had a block of code wrongly indented. ;) See [5969]. This would only cause problems if you had multiple movies embedded on the same page.

I think your JavaScript might execute before the page is rendered, that is why my script is in the HTML code. It only executes after document-ready, IIRC.

comment:9 Changed 8 years ago by anonymous

OK :) Now we've got some progress. After adopting your mentioned indentation change, I actually have the <script> node in the generated html. By the way, I did have to embedded movies in one page the whole time: one youtube video, and the local one I'm trying to get running.

Now, after I changed the indent and recompiled the local file works - but only, if it is the only embedded video. When I reactivate the youtube video, the local one is only an <a> tag again.

BUT, I do see an error in firefox's error console in this particular case:

Error: \$("a.flowplayer").flowembed is not a function


comment:10 Changed 8 years ago by anonymous

I misspelled:

... By the way, I did have two embedded movies ...

comment:11 Changed 8 years ago by anonymous

Ok, another interesting phenomenon:

If I embed the local file, then a youtube video afterwards, both work. If I do that the other way around, I get the above mentioned error (flowembed is not a functon) and only the youtube one works.

comment:12 Changed 8 years ago by lcordier

I know what is going on, basically I should only include the <head> scripts once for flowplayer but currently it will only work when a local file is embedded first on the page. I will have to find a more elegant why of doing it. I have an idea that could work, I'll look at it over the weekend.

comment:13 Changed 8 years ago by anonymous

Alright :-) Since I only need local files (at the moment), it works fine now. I can use as many local files as I want and everything works.

Good work on this macro! Looking forward to more :-)

Thank you

comment:14 Changed 8 years ago by lcordier

• Resolution set to fixed
• Status changed from new to closed

I used a more elegant method to deal with multiple embedded flowPlayers [5987].