Flask Jinja2 fetch row <audio src="LINK" /> not working - flask

I add file as <audio src="LINK" controls /> to mysql.
When I fetch mysql row it not show audio player but show text <audio src="LINK" controls /> instead of embeded audio player

Related

how can i send a small data like a url to the new tab that a chrome extension opens?

So i have the following code that upon clicking the button opens the localhost main html file where flask app.py is running on flask server
$("#startbutton").click(function(){
chrome.tabs.query({'active': true, 'lastFocusedWindow': true}, function
(tabs) {
urlPresent = tabs[0].url;
//var myWindow = window.open("http://localhost:3000/", "_blank");
//myWindow.document.write("<h1> urlPresent</h1> "+urlPresent);
window.open('http://localhost:3000/', '_blank');
});
flask server is running at http://localhost:3000/
Now i have url of the active website, is there any way i can send this urlPresent variable to the new tab that opens from this button #startbutton to the html file on server whose code is
<form action="{{url_for('scrap')}}" method="post" id="theform">
<b>
Enter Review:
<input type="text" name="reviewfield" value="" id="inputfield"
/></b>
<br />
<br />
<input type="submit" value="Scrap and Predict" />
</form>
</center>
and set it to the value of the form input type text.
PS: I have the webpage that is automatically populated with the url (with the help of chrome extension - i know it would be simpler to just copy the url but my professor wants me to automate it) which is then scrapped and feeded into the classifier and then the results are returned.

Load image in CustomListIem cell

I´m trying to populate a CustomListItem cell in SAPUI5 with an image from my project´s source folder, but it is not showing on the cell. It is placed directly in the WebContent folder: App/WebContent/TEST.jpg, and the view code:
<Page title="View" showNavButton="true" navButtonPress="onBack">
<content>
<CustomListItem type="Inactive">
<Image src="{TEST.jpg}" class="content" />
<Button text="Press me!" class="content" />
</CustomListItem>
</content>
</Page>
the button is being shown in the first cell of the list (where the image should be), but not the image, does anyone know how can I fix it?
You need to change the url path in the src property. If you enclose it in the brackets ({}), SAPUI5 expects a property binding path which in you case is invalid.
So replace this,
<Image src="{TEST.jpg}"
with
<Image src="TEST.jpg"

video js forwording is not working with django in chrome

Video js is not working in chrome (latest version) with django 1.8. It is working well in firefox and IE. In chrome, video is playing well but when i click on the scrum to forward and backward video, video restarts again. I also tried with CDN but It result same:
<video id="ml_video" class="video-js vjs-default-skin" controls preload="auto" data-setup="{}" width="100%" height="400px" src="{{ mn_video.url }}">
<source src="{{ mn_video.url }}" type='video/webm'></source>
<source src="{{ mn_video.url }}" type='video/mp4'></source>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider
upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">
supports HTML5 video
</a>
</p>
</video>
NOTE:
I tried it with django development server as well as with gunicorn.
I do not get any error in console as well as in terminal.

Seeking HTML5 video at a particular position in a web page

Following code is working but it is not starting the video from 3 seconds on my page
<video id="vid1" width="320" height="240" controls>
<source src="iphone16.mp4#t=3,9" type="video/mp4">
</video>
I am using Django for development of my web application. Any idea why it's not working in my case??
Thanks in advance

Django embed m4v from static locally

How would you embed a static file with .m4v extension , M4V is a file format,
<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"
codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="256" >
<param name="src" value="/static/example.m4v">
<param name="autoplay" value="false">
<param name="controller" value="true">
<embed src="/static/example.m4v" type="video/mp4" width="320" height="256" controller="true" controls="true" autostart="false"/>
</object>
The above example forces it to download.
http://django-embed-video.readthedocs.org/en/v0.11/index.html only works with online sites like youtube, few others.
I was struggling with this same issue. I pretty much copied the code from http://camendesign.com/code/video_for_everybody.
<!-- first try HTML5 playback: if serving as XML, expand `controls` to `controls="controls"` and autoplay likewise -->
<!-- warning: playback does not work on iOS3 if you include the poster attribute! fixed in iOS4.0 -->
<video width="640" height="360" controls>
<!-- MP4 must be first for iPad! -->
<source src="__VIDEO__.MP4" type="video/mp4" /><!-- Safari / iOS video -->
<source src="__VIDEO__.OGV" type="video/ogg" /><!-- Firefox / Opera / Chrome10 -->
<!-- fallback to Flash: -->
<object width="640" height="360" type="application/x-shockwave-flash" data="__FLASH__.SWF">
<!-- Firefox uses the `data` attribute above, IE/Safari uses the param below -->
<param name="movie" value="__FLASH__.SWF" />
<param name="flashvars" value="controlbar=over&image=__POSTER__.JPG&file=__VIDEO__.MP4" />
<!-- fallback image. note the title field below, put the title of the video there -->
<img src="__VIDEO__.JPG" width="640" height="360" alt="__TITLE__"
title="No video playback capabilities, please download the video below" />
</object>
</video>
<!-- you *must* offer a download link as they may be able to play the file locally. customise this bit all you want -->
<p> <strong>Download Video:</strong>
Closed Format: "MP4"
Open Format: "Ogg"
</p>
Then made sure to create .htaccess file with the following:
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
Also, I'm using an older version of django (1.6.5) for my project and I have my videos stored at my MEDIA_ROOT and have the MEDIA_URL also set in the settings.py so that the source of video looks like:
{{ MEDIA_URL }}/media/videos/video.m4v