We have moved to a new Sailfish OS Forum. Please start new discussions there.
15

Browser: don't stop playback when switching tab

asked 2015-07-06 09:30:13 +0300

Mikaela gravatar image

updated 2015-07-12 18:44:05 +0300

All Finnish web radios are at radiot.fi and they don't have native Sailfish app, so I added it as bookmark and then added the bookmark to app launcher, however there are two issues:

  1. When I open another browser tab, the playback stops until I move to the radiot.fi tab again.
  2. If I click some link in another app (IRC/Communi Sailfish), the browser opens that link over the active tab meaning radiot.fi.https://together.jolla.com/question/45661/opening-an-url-no-longer-opens-a-new-tab-since-10716/

Both are very annoying, I think there may be reasons for 1. but I can think of another use case where the playback is wanted to continue for example listening music from youtube/youtify. 2. I think must be a bug.

Update: I was told that there was already thread about 2. which I didn't find because of wrong keywords.

edit retag flag offensive close delete

Comments

1

Good point if it is the desired behaviour. If not, it could easily lead to heavy battery drain. So it should be an optional feature anyway.

lakutalo ( 2015-07-06 10:33:12 +0300 )edit

3 Answers

Sort by » oldest newest most voted
1

answered 2015-07-10 17:46:01 +0300

late88 gravatar image

Here's what I did:

Downloaded the preferred radio station link as a m3u -file (a playlist). You can easily do it with pc, but also with android firefox and transfer to phone if needed. After that it is really easy to listen the radio streams with native media player! Links are listed as playlists. Downside is that only the few first letters are shown in the media players main view. You can change the file name to desired (i.e. Rock radio instead of Radio rock) and enjoy.

edit flag offensive delete publish link more
3

answered 2015-07-06 20:37:51 +0300

If you want a browser that supports real tabs, use Web Pirate. It is available at Jolla Store and Openrepos (https://openrepos.net/content/dax/webpirate). It is open source, code is available at https://github.com/Dax89/harbour-webpirate

edit flag offensive delete publish link more

Comments

This isn't a solution as this is bug with the default browser and also introduces new issues:

  • radiot.fi doesn't play at all with Web Pirate and apparently scrolling etc. is entirely impossible.
  • Web Pirate suffers from the exact same bug unless I misunderstand this issue.
  • Default browser cannot be changed yet (without hacks in developer mode that I would probably have to do)
Mikaela ( 2015-07-06 21:57:50 +0300 )edit

Unfortunately, Web Audio doesn't work with QML WebView (the last time I have checked it was disabled along with HTML5 audio and video tags).

The only workaround that I know is to grab direct links and give it to a Video/Audio/MediaPlayer QML objects, WebPirate works in this way.

@jollailija: Don't give up, using a WebView is the right way! Of course you can't play audio/video directly with it. If you want to target to that website only, you can grab direct links using a user javascript inside your WebView and send it to a QML Audio object (like I said above).

I'm happy to help you, if you want!

Dax ( 2015-07-06 22:32:10 +0300 )edit

@Dax Some help would be useful, as I am just a young starting hobbyist. Also, I think my app doesn't work for both of the reasons I said before: Audio and the rendering of the buttons (on the website). The latter isn't that big of a deal as the audio should start automatically anyway if it worked.

jollailija ( 2015-07-07 09:42:49 +0300 )edit

Also, the whole rendering of the website is pretty bad with WebView, what if I abandoned that and instead went with a list view of the radio stations? The UI could be like the Media player's. I can do the UI but I will need help with getting the audio working.

jollailija ( 2015-07-07 09:47:00 +0300 )edit

@jollailija: The Audio element is easy to use, look here: http://doc.qt.io/qt-5/qml-qtmultimedia-audio.html Yes, you can also use a ListView element for radio stations.

Dax ( 2015-07-07 10:58:58 +0300 )edit
4

answered 2015-07-06 12:59:59 +0300

updated 2015-07-14 17:51:35 +0300

The browser doesn't support having multiple "active" tabs. As a workaround you can install another browser from the Jolla Store and use it for just listening to the radio while browsing the web with the default browser.

Edit x(I have lost count): My app "Nettiradio" is now available at Jolla Store! You can also install latest versions from OpenRepos: https://openrepos.net/content/jollailija/finnish-net-radio-client-beta

edit flag offensive delete publish link more

Comments

2

Boom, I made the code, now someone can submit it to Harbour :) Please give me a little credit, though.

http://pastebin.com/UmpKThUV

jollailija ( 2015-07-06 13:11:22 +0300 )edit

Thanks a lot! What sort of credit did you have in mind? :)

lakutalo ( 2015-07-06 13:41:20 +0300 )edit

Just mention my username in the app description or something if you will :)

jollailija ( 2015-07-06 13:45:29 +0300 )edit

Edit: By the way, have you tried QuickRadio or SailWave? Those are available on the Jolla Store.

Yes, I have. They just have the issue of requiring inputting radio stations by hand and I know no station in Finland that makes the stream address easily available on their own websites. I have no idea about QuickRadio, but SailWave had no presets and even if it had, it wouldn't probably have anything I would listen so the presets would just annoy me.

Y-Radio might be an option, but as the name says, it's only for YLE and I usually don't listen their stations.

Mikaela ( 2015-07-06 16:54:36 +0300 )edit

@jollailija I have no idea how to compile that code and why you don't send it to harbour by yourself? Unless I misunderstood something, it's free.

Mikaela ( 2015-07-06 16:55:24 +0300 )edit
Login/Signup to Answer

Question tools

Follow
3 followers

Stats

Asked: 2015-07-06 09:30:13 +0300

Seen: 716 times

Last updated: Jul 14 '15