media

CSS: @media print without external css file?

不打扰是莪最后的温柔 提交于 2019-12-25 00:58:07
问题 I want to print a html page in a specific way under css. But all the @media print examples seem to have an external .css file I want to be able to do it without an external file which means there will be no link rel tag: <LINK REL="stylesheet" MEDIA="print... How do I do this? 回答1: I would suggest using an external stylesheet but you can how ever do this on the same page as your HTML if you really want to, an example of this would be like so, HTML / CSS <!DOCTYPE html> <html> <head> <style>

Mapping two MEDIA_URLs to the same MEDIA_ROOT

女生的网名这么多〃 提交于 2019-12-24 20:22:53
问题 I’m migrating a website from WordPress to Django/Wagtail. I have all the old WP content in my media directory & it’s all being served appropriately. It would be convenient to map other URLs (specifically /wp-content/ ) to MEDIA_ROOT , for the sake of old media URLs that were hardcoded in the content. So for example a migrated asset now available at //example.com/media/uploads/2017/12/IMG_2120.jpg can also be served from //example.com/wp-content/uploads/2017/12/IMG_2120.jpg I’m sure there’s

Why does the browser load audio files several times even after preload?

淺唱寂寞╮ 提交于 2019-12-24 18:52:50
问题 i am monitoring the network on Safari mobile for a Web App we are developing and see this: the files get preloaded before (I guess this is why it says "(disk)" in the first of the 3 lines), and this is the network output in safari's web inspector in the network tab. Now I am wondering, why the browser seems to load it first from disk then two times(?) from the url again. Am I reading the output wrong? preloading happens like this (on user interaction): function preloadAudio(url) { console.log

Android MediaMetadata image on lockscreen is zoomed

梦想与她 提交于 2019-12-24 15:43:53
问题 When playing media, I am able to place media image onto a lockscreen via RemoteControlClient.MetadataEditor editor = remoteControlClient.editMetadata(true); editor.putBitmap(RemoteControlClient.MetadataEditor.BITMAP_KEY_ARTWORK, bitmap); or MediaMetadataCompat.Builder builder = new MediaMetadataCompat.Builder(); builder.putBitmap(MediaMetadataCompat.METADATA_KEY_ART, bitmap); however, if I use landscape source image (16:9) and lockscreen orientation is potrait, the background image is zoomed

Silverlight: Expose audio with specific start and stop times

白昼怎懂夜的黑 提交于 2019-12-24 15:05:48
问题 From an audio-file I want to be able to expose audio on a webpage, but between specific start and stop times . Say I have a audio-file that is 45:30 , for example, and I want to expose it for streaming and download between 7:25 and 8:30 , but also between 6:20 and 9:27 . What do I need in term of special services , Silverlight-controls and maybe some sample-code for this. Bonus-question : Is there already an online-service for this? 回答1: Seb, I assume that when you say "expose" that you mean

Phonegap - How to trigger media scanner after creating file

落爺英雄遲暮 提交于 2019-12-24 07:00:09
问题 I have the following code (this is a plugin to save a base64 as an image file on the phone) @Override public boolean execute(String action, JSONArray args, CallbackContext callbackContext) { if (!action.equals("saveImage")) { return false; } try { String b64String = args.getString(0); if (b64String.startsWith("data:image")) { b64String = b64String.substring(b64String.indexOf(',') + 1); } JSONObject params = args.getJSONObject(1); //Optional parameter String filename = params.has("filename") ?

Running mpg123 with FIFO control?

百般思念 提交于 2019-12-24 06:35:08
问题 I need to run mpg123 with a single file, such that it will autostart and autoclose, like it normally does, however, I need to be able to override this default behavior with commands sent to a fifo file. I had been running mpg123 filename.mp3 from a script, and simply waiting for it to finish before moving on. However, I'd like another script to be able to pause playback, control volume, or kill the process early, depending on the user's input. mpg123 -R --fifo /srv/http/newsctl filename.mp3

AMediaExtractor setDataSource AMEDIA_ERROR_UNSUPPORTED error on Android Q

无人久伴 提交于 2019-12-24 04:54:11
问题 I am working with AMediaCodec and AMediaExtractor , all works fine on all devices(I hope:), but if I check the same code on Android Q (in my case Pixel 2XL) I got such error AMEDIA_ERROR_UNSUPPORTED . What I do bool NativeCodec::createStreamingMediaPlayer(const std::string &filename) { AMediaExtractor *ex = AMediaExtractor_new(); media_status_t err = AMediaExtractor_setDataSource(ex, filename.c_str());; <-- Here media status I got AMEDIA_ERROR_UNSUPPORTED if (err != AMEDIA_OK) { __android_log

Mediaplayer plays twice

时光毁灭记忆、已成空白 提交于 2019-12-24 02:42:40
问题 I have a media player but when another file is selected it continues to play the old file and new one so it is playing two files at once here is my onCreate method private MediaPlayer mediaplayer = new MediaPlayer(); private Handler handler = new Handler(); @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); setContentView(R.layout.songplaying); // Getting Our Extras From Intent Bundle names = getIntent()

Default header p:media with pdf player

雨燕双飞 提交于 2019-12-24 01:24:16
问题 I'm programming a <p:lightBox> with a streamed <p:media> to preview external PDFs. It works fine but i'm getting a little handicap. When the pdf dialog is rendered it shows (on mouse over) one Header where it always display the same title: "dynamiccontent.properties". Is there an attribute or something that I can override to customize it? JSP code: <p:lightBox> <h:outputLink value="#" title="#{myDoc.fileName}"> <i class="fa fa-eye" aria-hidden="true"></i> </h:outputLink> <f:facet name="inline