![]() |
#1 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Apr 2015
Device: none
|
Sigil with audio files
Does anyone know that when you embed an audio file with Sigil into an epub that Sigil creates an icon that must be clicked to play the audio file, or does the audio file automatically get played when the page where it is embedded is displayed/opened?
Steve |
![]() |
![]() |
![]() |
#2 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,891
Karma: 59840954
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
In other words, it is similar to images. You can add the audio file to the ePUB, but playing it must be done in the coding yourself. There is not a button for that like for an image.
|
![]() |
![]() |
![]() |
#4 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
As for the playback controls, AFAIK, they don't need to be explicitly defined. Sigil playback controls support appears to be OS-dependent: Windows: The official Windows Sigil 0.8.5 release automatically displays disabled playback controls. Linux: DiapDealer's unofficial Sigil Linux 0.8.5 release automatically displays working playback controls. OSX: Sigil audio/video playback works, according to KevinH. (The test file is a valid ePub3 file that works with iBooks, Gitden Reader, ADE 4 and Readium.) Here's the HTML code: Spoiler:
Last edited by Doitsu; 07-12-2015 at 02:17 AM. Reason: Updated for ePubCheck 4 compatibility; added ADE 4 information |
|
![]() |
![]() |
![]() |
#5 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,351
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If I remember correctly, the audio/video folders were added and some bare minimum coding was done to ensure that Sigil didn't break existing (working) epubs that had video/audio in them. But I don't believe adding/editing/playing has ever been supported (though playing might work depending on OS and video/audio codec).
It was a "first do no harm" sort of step toward audio/video support. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi
Video seems to work for me with the latest Qt and some added style to makes the controls appear. |
![]() |
![]() |
![]() |
#7 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
|
![]() |
![]() |
![]() |
#8 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
To create a test case I used the html Sigil uses if you double-click in the Browser pane to open a Tab with audio and or video. Here are those code snippets. You just need to replace the src="" link with ../Video/your_movie_name.mp4 Code:
const QString AUDIO_HTML_BASE = "<html>" "<head>" "<style type=\"text/css\">" "body { -webkit-user-select: none; }" "audio { display: block; margin-left: auto; margin-right: auto; }" "</style>" "<body>" "<p><audio controls=\"controls\" src=\"%1\"></audio></p>" "</body>" "</html>"; const QString VIDEO_HTML_BASE = "<html>" "<head>" "<style type=\"text/css\">" "body { -webkit-user-select: none; }" "video { display: block; margin-left: auto; margin-right: auto; }" "</style>" "<body>" "<p><video controls=\"controls\" width=\"560\" src=\"%1\"></video></p>" "</body>" "</html>"; KevinH |
![]() |
![]() |
![]() |
#9 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
I tested with Sigil from my master which now keeps even more of the epub3 features and your audio file (both channels) showed up and played just fine and worked correctly in BookView and Preview. I am attaching an epub_video_test_epub3.epub (it is an epub3 based only on the package version tag). It works on Mac OS X also. I also tested with stock Sigil 0.8.5 on Mac OS X and both audio and video tests work. The only issue is after saving the video in Sigil 0.8.5, the media-type was incorrectly changed to text/plain in the content.op manifest, which prevented it from working after a reload. This bug is fixed in my Sigil master. Hope this helps, Kevin Last edited by KevinH; 04-05-2015 at 01:50 PM. |
![]() |
![]() |
![]() |
#10 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,680
Karma: 23983815
Join Date: Dec 2010
Device: Kindle PW2
|
Hi KevinH,
Thanks for the funny test file. I tested it with DiapDealer's unofficial Sigil 0.8.5 Linux release on Debian 8 and the playback worked fine, even when I unlinked the stylesheet. Of course, the 0.8.5 Windows version didn't work. D. |
![]() |
![]() |
![]() |
#11 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi,
Yes, the code to deal with audio and video is inherent across the 3 platforms and built into the Qt QWebView widget. There is no bug from the Sigil end here. This seems to be an issue in QWebView for both audio and video in the QWebView widget but only for Windows platforms. I will try a web search to see if there is a workaround for and if so try to incorporate it into the next release as well as try to get the bug fix for the media-type in the content.opf backported in time for a Sigil 0.8.6 bug fix release. Both audio and video should work on Windows in Sigil, they just do not for some reason. Take care, Kevin |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
I played around a bit more and found out that Windows seems to need PluginsEnabled set on the QWebView widget to do anything and then a bunch of extra plugins added into Sigil. No where could I find this anyplace in the Qt docs but I did find it via google in just one place. With the following change to ViewEditors/BookViewPreview.cpp: Code:
--- BookViewPreview.cpp.orig 2015-04-02 12:20:42.000000000 -0400 +++ BookViewpreview.cpp 2015-04-05 16:04:23.000000000 -0400 @@ -72,6 +72,7 @@ // Enable our link filter. page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); + page()->settings()->setAttribute(QWebSettings::PluginsEnabled, true); CreateContextMenuActions(); ConnectSignalsToSlots(); } My video epub would simply not work no matter what. I replaced the sample mp4 video with a small.mp4 video I found on the web and then it worked as well. So not all mp4 will work but some do. I have no idea why yet. I will try to get these changes into Sigil 0.8.6 if I can. Take care, KevinH Last edited by KevinH; 04-05-2015 at 09:49 PM. |
![]() |
![]() |
![]() |
#13 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,351
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
![]() Someone using my linux packages was having issues with "normal" non-US keyboard functionality until I figured out (by sheer trial and error) that one of the platforminputcontexts plugins needed to be included with the package. Why there can't be a tool that clearly tells you which Qt Libraries and plugins need to be deployed with your application (on the current platform), I'll never know. |
|
![]() |
![]() |
![]() |
#14 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,450
Karma: 5703586
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
I tried the new windeployqt.exe that comes with the latest Qt5.4 for Windows on Sigil.exe just built on Win32 and it never even seemed to find or include any of the Qt plugins (after building with msvc2013_opengl). So I think for the next release we should probably include a wider range of plugins on Windows and test with an audio and video epub to at least give them a chance to work on Windows. Take care, KevinH |
![]() |
![]() |
![]() |
#15 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,612
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Little wonder I was never able to get it working - ended up using InDesign - it was a one off
![]() BR |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Multiple files, *-tmp.epub, are left in /tmp/Sigil/scratchpad after closing Sigil | Ahmad Samir | Sigil | 8 | 11-28-2012 04:27 AM |
Audio in epub format using sigil | TStphnsn | Sigil | 6 | 10-27-2012 04:39 PM |
Audio files | jgray | Workshop | 5 | 09-19-2009 01:16 PM |
Query about audio files | SolidSquid | Calibre | 1 | 06-12-2009 10:53 AM |