I am build a movie search web application (using Django) that will basically take a folder of movie files that end with (.mp4, .avi, .mpg etc). A MySQL database get filled with information about the movie when I run the population script.
One of the columns are the file_path of the movie. I have a template that will show some basic information for the movie with a play button next to it.
When you click the play button, it will take it you to another page (using the slug of the movie title) and you'll see an embedded video.
PROBLEM: Is that the movie doesn't play when I click the play button the embed video. The file_path to the video is stored in the database which is then passed into the django template (so I can see the path).
Is there some way to let django access these movie file paths so that they may play in the browser? (or using the default linux media player).
P.S. The movie file paths are stored in the MySQL database.
Here are the models:
class Film(models.Model): title = models.CharField(max_length=128, default='Blank', help_text='film title') year = models.CharField(max_length=15, help_text='release year', blank=True, null=True) rated = models.CharField(max_length=15, default=1, null=True, blank=True) released = models.CharField(max_length=128, default='Blank', help_text='release date') runtime = models.CharField(max_length=15, default='Blank', help_text='film length') genre = models.ManyToManyField(Genre, default=1, blank=True) director = models.ManyToManyField(Director, default=1, blank=True) type = models.CharField(max_length=20, default='filmdb', help_text='series, movie etc') actor = models.ManyToManyField(Actor, blank=True, verbose_name='Actor/Actress') writer = models.ManyToManyField(Writer, blank=True, verbose_name='Writer') award = models.CharField(max_length=128, default='Blank', null=True,help_text='film awards') country = models.ManyToManyField(Country, default=1, blank=True) language = models.ManyToManyField(Language) plot = models.TextField(max_length=256, help_text="Film plot", null=True, blank=True) poster = models.URLField(max_length=256, help_text='link to poster image', blank=True, null=True) imdb_id = models.CharField(max_length=15, default=1, null=True, blank=True) imdb_rating = models.CharField(max_length=15, null=True, blank=True) meta_score = models.CharField(max_length=10, null=True,blank=True) file_path = models.CharField(max_length=255, null=True, blank=True, default='N/A') slug = models.SlugField(unique=True) def save(self, *args, **kwargs): self.slug = slugify(self.title) super(Film, self).save(*args, **kwargs) def __unicode__(self): return self.title + self.year
moviea FileField? Please add your model to the question.