Question

Sorry up front if my terminology will be non-standard, but I am new to Django and Python...I am using Python 2.7.3 and Django 1.4.3 on a Mac OSX 10.7 (Lion). Django-autocomplete-light version 1.1.7.

I am using the django-autocomplete-light module to create a page where I can search within a set of videos (hosted on an external source like Youtube). I defined a model / app called Videos that contains a set of videos hosted on this third-party site. At the top of my videos/index.html page, I have a search box that is powered by the django-autocomplete-light module. I have gotten the overall search function working--when I type something into the search box, the relevant videos are shown in the drop-down menu automatically. I want the clicked video to play within an embedded player on the page--for some reason, this keeps on loading the video into the entire, existing document / page instead of just the iFrame. In my structure for the search box, I included the "target" attribute already. My understanding is that including "target" should work, but I must be missing something. When I check Firebug, the "target" attribute is included in the link in the search results (sorry, can't post a screenshot of this since I don't have enough reputation points...but it's there. The iFrame also has its "name" attribute assigned to the same thing).

Side note--I am hosting the video on a private service (not Youtube), so I prefer not to use a library like jQuery TubePlayer...but the concept remains the same).

My questions--is there another way to do this? Am I missing something obvious? Does django-autocomplete-light not play nice with iFrames?

(templates/videos/index.html)

<iframe name="tvplayer" width="560" height="315" src="http://www.youtube.com/embed/CE0Q904gtMI" frameborder="0" allowfullscreen></iframe>

(navigation_autocomplete/autocomplete.html)--I understand that all videos will return the same link using this code, but I can't even get this one to work!

{% for video in videos %}    
    <a style="display:block" href="http://www.youtube.com/embed/3svKWr9LH4I" target="tvplayer">{{ video.title }} - {{ video.desc }}</a> 
{% endfor %}

Thanks for your help!

Was it helpful?

Solution

Solved my own question...within the navigation_autocomplete/script.html page, you have to change the navigation_autocomplete javascript handler directly since it overrides any other styling / parameters that you put into the a tag.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top