Git Product home page Git Product logo

relove's People

Contributors

amcbain avatar gargaj avatar

Stargazers

 avatar  avatar

Watchers

 avatar

relove's Issues

Long chat messages without natural break points don't wrap

Long chat messages that don't wrap create a horizontal scrollbar. This is bad, because being that it is all in a table, when the table stretches out all other lines will stretch out too, not just the troublemakers.

An example of a reLive show with this problem is Scenes from the Burgh on 2014-12-28. At about 12:04 in the chat log (2014-12-28 20:04:25 in the tooltip) several messages by a user "zeg" show up that have no spaces or natural break points in them.

This can be fixed many ways, but most solutions are subpar. Of those, I've tried:

  • table-layout: fixed; (username column no longer resizes to fit contents)
  • Inserting between each character of a message (could cleave normal words at odd points)
  • Inserting a zero-width space between each character (it gets copied with the regular characters)
  • Inserting a soft-hyphen between each character (same as zero-width space)
  • Overriding the table styles with flexbox ones (the username elements are no longer the same width)
  • Setting a dynamic max-width and word-wrap: break-word; on the last td of each row

(Most of those solutions also take a long time when rendering a large amount of the chat log to catch up to where the user requested playback to be or when loading a link to a stream further in.)

The last solution above is the most promising but requires the most work. In it the max-width for the last td is set to the width of the parent minus the scrollbar, the width of the first td, and the width of the second td. The problem is if someone resizes the browser it will be too short until the next message is posted and it is recalculated. To ensure that it isn't recalculated on every insertion, a timeout can be used that is cleared on each new line with a very low value, such as 1, so that if a bunch of lines are inserted at once only the last one triggers the change.

Except for the window resizing, this isn't the worst solution in the world. The window resizing requires tying in to such an event which as an element that is created and torn down many times (potentially) during the lifetime of the app is a bad idea to leave hanging around. There is no repaint method like the annotated player, but one could be added to handle the event from the Replayer in the same way.

(It may also need to check if the chat area should scroll down after the fix, as it's possible that it could jump due to the additional vertical rows that now exist and it will execute after the scrollbar is pushed down due to the addLine check.)

Replayer page (for streams) is still scrollable even with the scrollbar off

In Chrome just use the scroll wheel. In Firefox use the middle click then move the mouse down. One way to fix this might be to kill the scroll event by preventing the default when there isn't supposed to be a scrollbar. Add the event when not scrolling allowed there and remove it when it should be allowed again.

Show buffered progress on the progress indicator

Using https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery/buffering_seeking_time_ranges it is possible to show the buffered progress (even individual segments if the user skips around) as a translucent black overlay. To be unobtrusive such a thing could be shown along the bottom as a one or two pixel set of lines until the entire file is buffered, then it goes away.

This would help slow connections for people who want to skip around and until range requests are implemented it'll let any savvy beta testers in to how far ahead they can seek.

Refactor ChatView to own its data

The ChatView should own and display its own log. It should get events somehow hooked up so it knows when to advance. Take the responsibility out of replayer.js

Integrate web-based protocol handling

https://developer.mozilla.org/en-US/docs/Web-based_protocol_handlers

I believe at least Firefox and Chrome can handle the above. It seems you could have something that knows what to do with "relive:" based in the web. The browser would take it and pass it off to the web app as #relive:stream-8-3G but this has a few potential issues and questions.

  1. What happens if the user allows the web app to have relive and later installs the desktop app? Which gets relive requests?
  2. Does doing that in the reverse order cause the web app to be prioritized over the desktop app? (or just fail to register)
  3. Can a user uninstall the reference to the handler at a later date if they choose? (In Firefox it doesn't seem like there's an easy way to do so.)
  4. Would users actually see this as a useful feature?
  5. Does the web app ask automatically only ask when a menu item is clicked?*

* Of course it would only ask once as long as a localStorage value persists so that if it was asked once it doesn't keep asking. If it was based on a menu item, then if the user declined it after clicking the menu item, the menu item would remain if isProtocolHandlerRegistered exists and can tell us otherwise it would be hidden and squashed in the future by the localStorage value. If localStorage doesn't exist it would seem better not to ask at all even if the function to do exists so that the user isn't asked every time on start. Especially since if the protocol is already registered by the site asking again presents a message to the user. :-/

Document styling for the chat log display

Shouldn't be that hard, there's not that many chat types (0 to 9) to document what they are and what shows up in each column for that type. Also include which element to apply the background to for people who want a dark one.

Support history.pushState and the popstate for navigating within the app

If support for history.pushState exists, then push states for the various application actions:

  • Clicking to the list of stations vs latest streams list
  • Clicking in to a stream

If history.replaceState is supported, when pausing replace the last state if it has a hash to be the current value. The hash is already changed on pause, but this adds a new history item. It would seem odd to hit back and cycle through all the locations that were paused at. (This does mean though that if someone arrives at the app via a URL with a hash, hits pause, then hits back, then goes forward again they'll land at the paused location not the original one they started with. However I don't think that's a huge problem.)

The previous hinges on the popstate event support, though. Check that first.

The hashchange event could be used to sort of work around the lack of history events, but it's kind of crude and would end up with the issue noted above where you'd end up skipping back through the stream based on whenever you decided to pause it. Doesn't really seem worth it.

Allow users to change the scrollback styles from the UI

CSS now has the concept of variables, which work on the client-side. Browsers that don't support variables would just ignore them and, presumably, that support could be determined with a quick check.

If variables are supported, then a menu item could be added to offer an overlay/dialog of some sort that lets them pick and stores the result in localStorage so it sticks every time they return.

This isn't a big deal since most usages of this app would be embedded, at least as far as I know, and so anyone deploying it would probably configure it in the stylesheet to their preferences so everyone visiting has the experience they desire.

Certain chat messages don't cause auto-scrolling like they should

The scrollbar can get stranded like if the user scrolled it up based on certain messages. Presumably large messages are what does it as their addition causes the check after insertion to determine the scrollbar is too far away from the bottom.

I think the solution is to check whether or not the auto-scrolling should be performed before inserting the new line, then doing the scroll down after the insertion.

Create an embedded version for loading specific shows or listing a single station

Seems that as this is a web app, it could also be suitable to use with an iframe as an embedded deal. The base version as it stands now would get a bit clunky with support added for this not to mention the overhead of having to wait for all the stations and streams to load before getting around to the one the iframe URL asked for.

The current relive.js API just needs a station ID to load the list of streams for a station or a station ID and a stream ID to load a specific show. Thus a URL could, through base 62 encoding, give the details of what to load. These URLs are already generated by the app (or other reLive apps) so they're suitable for easy use here.

A separate embed.html can load an embed.js (separate from app.js) to set up a version that does only what is needed. An embedded version for a specific show should not have a back button, and those for a given station should show only that station.

Add support for the progress area in IE9

The progress area uses a progress tag, which doesn't show up until IE10. It's not necessarily that hard to do, just make it behave like the volume elements do. I'd rather I be able to use progress and meter for both, but IE decided not to support the meter tag.

Seeking and brushing (tooltip) should still work in IE9, it just won't render or advance the position indicator. So users on IE9 won't know where they are in the stream except by announcement within the audio.

Clue in users to audio errors in a better way.

Currently the code just sets a CSS class of 'bad' on the progress area, which floods the background with a bunch of exclamation point like drawings. It would be useful to indicate to users why this happened. This info is helpful in trying to fix it or indicating lack of browser support for some things.

Add fallback if seeking via native HTML5 audio takes too long

Chrome doesn't like custom implementations of range requests even if the support conforms to the specification. Ziphoid noticed this here and I also in one of my own personal apps. A fallback for this would also cover websites that don't support range requests.

If the seeking takes more than X seconds (5, 10?) set a flag and do all further seeks (until page refresh) by changing the stream URL to have a start parameter that corresponds to the desired location.

From what I remember of what Ziphoid told me this requires knowing the bitrate as the start position is in bytes, not seconds. (This would make sense if the server-side was done naively, as it is very easy to do and format agnostic.)

This is listed as a bug because the seeking doesn't do what users expect it to if range requests fail. It makes the app much less usable for those who want to skip around.

Rewrite this project in React+Redux and properly componentize it

This project is all in raw HTML and JavaScript with no library dependencies. This means it can be made packaged very small, if you're willing to bother. It also has no build environment requirements or any new fancy features helpful to developers.

Many parts of this will become Components making it very easy to add the component anywhere inside of a React app.

Replayer panel in Safari 7.0.6 (9537.78.2) is only has tall as the current contents and grows with them

The replayer area isn't getting the correct height by default and is only as large as the contents currently in it. This means it only shows the progress area by default and grows as chat lines are added. It does not seem to have a bounded height like it should and will continue past the height of the viewport as it grows.

Maybe move to ditching calc here and use a fixed height for the section based in vh? The contents are already mostly absolutely positioned. The header can be left alone and the chat view can be moved to absolute positioning. One less calc is probably for the better.

(Incidentally this particular issue doesn't show up in the various notes on caniuse.com or via a Google search. It could possibly be isolated, but like a prior bug worked around it may prove hard to make in to a test-case. Caniuse also indicates the usages of calc in this project do not run afoul of prior lacking Android implementations, though only direct testing on such devices will tell. Theres's also no rush to remove them all in favor of other styles due to an informal minimum of IE9, which supports calc, for this project.)

relive.js reqest errors are not handled

If a request to get data via the relive.js library fails, it isn't handled. This is largely due to the fact that the library has no error handling trap short of replacing ReliveBinaryRequest with a patched version that handles errors.

So if you start up the app over https, Firefox (and probably Chrome too) will block the requests because they're less secure than what the page itself was served over.

Change URL to allow bookmarking specific streams

Update the URL to include the current location within the app (what stream is being viewed) and [on pause?] indicate where in that stream the user is. This makes it easy to bookmark things to come back to them later, or share them with others. (Very much similar to the links generatable by the desktop reLive app.)

Review and reduce usages of CSS's calc function

Seeing as one bug has been discovered in Safari due to calc, and the relative newness of the feature, it seems that the project may benefit, perhaps in unforeseen ways, from the removal of this crutch to get going so quickly.

The bottom value for the segments sidebar is an easy candidate for removal, given that a bottom value + a margin-bottom can achieve a similar effect to the current use of calc there.

Improve overflow / provide way to read entire text

One line text is used in a lot of places, and it could have a tooltip if it overflows or something else to indicate what the rest of the text is. Other options could include adding styles to properly handle multiple lines in those places.

Places using single lines currently include: stream listing heading and host lines, the page header area, the segment list, and the title area above the progress section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.