Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for different media types #769

Open
charlotteguard opened this issue Jul 30, 2024 · 15 comments
Open

Support for different media types #769

charlotteguard opened this issue Jul 30, 2024 · 15 comments
Assignees

Comments

@charlotteguard
Copy link

charlotteguard commented Jul 30, 2024

User Story: As a fxer I want to add videos to my obs, as a user I want to view obs with media types outside of photos

Fxers can add different media types, users can view different media types
Only download thumbnails but not the whole image
Only forecasters can add video into an ob so we don't need to support adding video to observation in the app
pdfs

Asana Link

@charlotteguard charlotteguard self-assigned this Jul 30, 2024
@yuliadub
Copy link
Collaborator

Fxers = forecasters 😄 somehow that wasnt immediately apparent to my Friday brain.

@yuliadub
Copy link
Collaborator

example of an obs that has a video in it:
https://nwac.us/observations/#/view/observations/c343930e-7eba-4ea5-b2d0-09f6c9fada74
https://nwac.us/observations/#/view/observations/48641fc7-5d12-4855-a189-5a5841c6e332

You will need to go into ... More, developer Menu, Time machine (select a date in last season) to be able to view these older (last season) obs.

@stevekuznetsov
Copy link
Collaborator

Here are the known media types:

export enum MediaType {

Here's where the type is defined:

.discriminatedUnion('type', [emptyMediaSchema, nullMediaSchema, imageMediaSchema, videoMediaSchema, externalMediaSchema, photoMediaSchema, pdfMediaSchema, unknownMediaSchema])

We already support:

  • image

We need to support, perhaps in order:

  • video
  • pdf
  • external

Need to figure out what 'photo' is and how it's different from 'image', example of an ob with one:

SNFAC ob { "announcement": null, "author": "Ethan Davis", "avalanche_center": { "city": "Ketchum", "id": "SNFAC", "name": "Sawtooth Avalanche Center", "state": "ID", "url": "https://www.sawtoothavalanche.com/" }, "bottom_line": "

Wind and 1-2 feet of snow will combine to quickly increase the likelihood of natural and human-triggered avalanches through Thanksgiving Day. These slides are most likely on slopes with enough pre-existing snow to cover rocks and logs. Don’t expect the new snow to bond well to the generally weak underlying snow surface. Cracks shooting from your boards or feet are a sure sign you’ve found a sensitive slab.

\n

We will update this post on or before Tuesday, December 3rd, 2019.

", "created_at": "2019-11-26T19:34:50+00:00", "danger": [], "expires_time": "2019-12-04T06:00:00+00:00", "forecast_avalanche_problems": [], "forecast_zone": [ { "id": 714, "name": "Galena Summit & Eastern Mtns", "state": "ID", "url": "https://www.sawtoothavalanche.com/forecasts/#/galena-summit-&-eastern-mtns", "zone_id": "3" }, { "id": 715, "name": "Soldier & Wood River Valley Mtns", "state": "ID", "url": "https://www.sawtoothavalanche.com/forecasts/#/soldier-&-wood-river-valley-mtns", "zone_id": "4" }, { "id": 716, "name": "Sawtooth & Western Smoky Mtns", "state": "ID", "url": "https://www.sawtoothavalanche.com/forecasts/#/sawtooth-&-western-smoky-mtns", "zone_id": "2" }, { "id": 717, "name": "Banner Summit", "state": "ID", "url": "https://www.sawtoothavalanche.com/forecasts/#/banner-summit", "zone_id": "1" } ], "hazard_discussion": "

Remember all those photos that you took in October, diligently documenting snow cover? Well now’s the time to dig them out. Judging exactly when and where an avalanche will occur is nearly impossible but, as this storm approaches, having a mental map of current snow cover patterns will give you a big leg-up. Why? Avalanches are much more likely to occur in areas where newly fallen snow lands on a pre-existing snowpack.

\n

Snowstorms in late September and early October favored the Sawtooth and Western Smoky Mountains. The only direct observation we have from this area came from Ben’s hike in the Redfish Lake Creek drainage of the Sawtooths, where he reported a foot of snow on southerly slopes above about 8,000’ and 2-3’ of snow on shadier slopes at similar elevations. On the other end of the spectrum, we have the Soldier and Wood River Valley Mountains which are mostly bare dirt. Generally, you can expect the amount and total areal extent of pre-existing snow to diminish from the Sawtooths as you head south to Galena Pass and on into the Boulders, Soldiers, and Pioneer Mountains. Check the media gallery (below) for pictures. 

\n

For this storm, it’s the middle ground of the Smoky Mountains that may be the trickiest to assess. Last week, Ben and I visited the Upper Titus weather station near Galena Pass. The snow cover was highly variable, with dirt on sunnier slopes and up to 16” of weak, faceted snow on shaded aspects. A crust layer near the snow surface, topped with a dusting of recent snow and feathery surface hoar provided a concerning base. Galena Pass will also be the rough dividing line between higher snow totals to the south and lesser amounts to the north.

\n

Snow stability may change quickly both as the storm progresses, and from slope-to-slope, as you change aspect and elevation. Arming yourself with a general, mental map of pre-existing snow cover is a great first step, but shouldn’t out-weigh obvious signs of unstable snow including recent avalanches, cracking, or collapsing (whumpfs). Be on the lookout for areas with obvious signs of wind-drifted snow and expect these fresh drifts to be sensitive to your weight. If there’s enough snow to make carefree turns, or you’re trudging through stiff drifts past your knees, there may be enough snow to slide. Even small slides can have big consequences if they knock you off your feet and drag you through trees or over cliffs.

", "id": 77584, "media": [ { "caption": "(11/20/19) Ben and Ethan walked out Titus Ridge near Galena Summit to work on a weather station. While they were there, they checked in on the state of the current snowpack.", "id": 1, "type": "video", "url": "OzWuSGJRGbw" }, { "caption": "(11/16/19) Cold Canyon near the headwaters of Trail Creek. ", "id": 2, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191116_ColdCanyonTrailCreek_03.jpg" }, { "caption": "Mid-November snow cover in the Central Sawtooths. ", "id": 3, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/IMG_1030.jpg" }, { "caption": "(11/7/19) Bare dirt is the name of the game on the south, southwest and western exposures of the Boulder Mountains. Some snow is hanging in the northwest bowl of Galena Peak.", "id": 4, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_GalenaPk_39.jpg" }, { "caption": "(11/7/19) This image shows a good amount of snow lingering in north-facing, alpine terrain of the Smoky Mountains.", "id": 5, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_NfacingSmokys_01.jpg" }, { "caption": "(11/7/19) East and northeast aspects of the Sawtooth Mountains including Cabin Peak and Snowyside Peak.", "id": 6, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_SnowysidePk_41.jpg" }, { "caption": "Here is the official snowfall forecast issued by the National Weather Service in Pocatello. ", "id": 7, "type": "photo", "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/Slide3.png" } ], "product_type": "summary", "published_time": "2019-11-26T23:18:00+00:00", "status": "published", "updated_at": "2019-11-27T21:14:19+00:00", "weather_data": null, "weather_discussion": "

The short term weather forecast just keeps getting better and better! That is, if you are in the Soldier and Wood River Valley Mountains (sorry Stanley and the Sawtooths). A well organized, low-pressure system is set to dip down into Northern California late Tuesday, churning Pacific moisture into the southern reaches of the forecast area. Steady snow showers will begin after dark on Tuesday and continue through the afternoon Wednesday delivering 1-2' of snow to the Soldiers, portions of the southwestern Smokys, and the mountains surrounding the Wood River and Little Wood River Valleys. The Sawtooths, shielded due to the southerly flow of this storm, will pick up 2-5\" by Thursday morning. 

\n

Snow showers are possible again Thanksgiving Day and Friday, but weather models diverge significantly in snow amount and location. Let’s just say, that snow on Thursday and Friday is certainly possible, and 3-5 more inches in some areas should not be surprising. An additional storm is starting to take shape over the weekend, but we’ll have a better handle on that as it draws nearer. 

\n

Don’t forget to follow along with this season’s storm-by-storm snow totals by checking our Storm Totals page daily.

" }

@rustynwac
Copy link

Kevin Hernandez is going to look into this and has some notes from the fall. Might be a bigger thing. Kevin will let us know and drop notes here.

@kevinherdez
Copy link

I had an extremely barebones prototype going that would at least show the videos, and I think I got hung up on mixing both media types in the same list. Here's kind of a quick overview of the problem, and I'll try to spec out more formally what needs done.

Issue

  • Right now we're using a package called react-native-image-viewing for supporting the full-screen image viewer
    • This package only handles images and has a lot of features like pinch-to-zoom, displays a header and footer, double-tab to zoom
  • To view a mix of video and images we would need to find a new package that already does this for us (when I was first looking into it, I don't think I found any), or create a custom component
  • In my initial investigation, it seems like all the video items are actually just youtube links. Displaying these media items would be different than downloading and playing a video if it were stored, for example, as an mp4. Do we know why this is and if it would be true for all videos in all centers?

Potential Solutions

  • I can investigate again to see if there's a package that I missed the first time around (this would be the easiest/quickest solution)
  • Create a completely custom image/video viewer which could be straight forward, but it would be a big change that we would need to extensively test before releasing it.
    • The idea here would be to create a FlatList that, depending on the item type, would display a video viewer or an image viewer
    • If we have to create a custom image viewer, it would need to have feature parity with the current package which would be a good amount of work

Open Questions

  • This is kind of just for my understanding, but does anyone know what the differences between all the media types are and when would we come across them? For example, what's an externalMediaSchema and what's the difference between imageMediaSchema and photoMediaSchema? The reason I ask is that we make a lot of assumptions that the images we're viewing are imageMediaSchema and that would need to be changed to support at least videoMediaSchema. However, since we're already doing the work to support more types, I'm wondering if we should do the work to support all types

Let me know if anything needs cleared up (I know that was a lot all at once), and I'll get my branch with this in a state where it works off of the current main.

@stevekuznetsov
Copy link
Collaborator

Do we know why this is and if it would be true for all videos in all centers?

Yes - we do not have the infrastructure for storing or streaming video, nor do the avalanche centers really want to get into that business. All of the videos will be external links to YouTube for all centers, I believe.

Create a completely custom image/video viewer

A middle ground might be to filter the list of media items and show two carousels - one that uses the existing image behavior, and one only for videos, if any exist. That would degrade UX slightly while making the dev work easier. I think a custom component would be the gold standard implementation, though - if you're up for it, I think it would be a good outcome for us to have something like this. I wonder how much we could lean on the existing library for implementation inspiration.

or example, what's an externalMediaSchema

These are links to social media, please see this example:

external YouTube video link
{
  "id": 115043,
  "published_time": "2022-12-18T02:00:00+00:00",
  "expires_time": "2022-12-19T02:00:00+00:00",
  "created_at": "2022-12-18T00:30:07+00:00",
  "updated_at": "2022-12-18T05:34:56+00:00",
  "author": "Irene Henninger",
  "product_type": "forecast",
  "bottom_line": "<p><span style=\"font-weight: 400;\">You can </span><a href=\"https://avalanche.org/avalanche-encyclopedia/trigger\"><span style=\"font-weight: 400;\">trigger</span></a><span style=\"font-weight: 400;\"> a widely </span><a href=\"https://avalanche.org/avalanche-encyclopedia/propagation\"><span style=\"font-weight: 400;\">propagating</span></a><span style=\"font-weight: 400;\">, dangerous </span><a href=\"https://avalanche.org/avalanche-encyclopedia/avalanche\"><span style=\"font-weight: 400;\">avalanche</span></a><span style=\"font-weight: 400;\"> on open slopes steeper than 30 degrees on a persistent weak layer. This is a scary moderate, where it&rsquo;s tough to say exactly how widespread or reactive the problem is, but we suspect it exists on most open slopes. Terrain selection puts control of the problem in your hands - travel along ridgelines, through dense trees, or on smaller slopes where less consequence from an avalanche exists. </span></p>",
  "hazard_discussion": "<p><span style=\"font-weight: 400;\">What we&rsquo;re seeing in the backcountry right now is a scary moderate. It appears to be getting harder to trigger avalanches on this persistent layer, however, the buried weak layer still exists. It is now more difficult to trigger an avalanche due in part to surface layers being harder but if you do trigger an avalanche on this layer the avalanche will probably be larger and more dangerous than the avalanches which occurred a week ago. Take this into consideration before stepping out onto large, high-consequence slopes.&nbsp;</span></p>\n<p>Looking into the future, snow surfaces are coated with a new layer of surface hoar, something to pay attention to as an unsettled weather pattern heads our way.&nbsp; If you make it out on Sunday, share what you saw with us by <a href=\"https://nwac.us/observations/submit/\" target=\"_blank\" rel=\"noopener\">submitting an observation</a>. The more information we have, the easier it is to produce an accurate forecast so that you can have a safer day in the backcountry.&nbsp;</p>",
  "weather_discussion": null,
  "announcement": null,
  "status": "published",
  "media": [
    {
      "id": 1,
      "url": {
        "external_link": "https://youtube.com/shorts/088v9zyEz6w",
        "external_type": "video"
      },
      "type": "external",
      "title": "12/17/22 Compression Test- Olympics",
      "caption": "(12/17/2022) <p>It took 21 taps to cause the surface hoar layer to fail, but it was a very pronounced collapse when the failure finally occurred. It's not as reactive as it once was, but this layer is still a concern throughout much of the Olympics.</p> Photo: Zack McGill- Cascade Mtn Ascents"
    },
    {
      "id": 2,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/image1-rotated_639bbd1a138f4-large.jpeg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/image1-rotated_639bbd1a138f4-medium.jpeg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/image1-rotated_639bbd1a138f4.jpeg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/image1-rotated_639bbd1a138f4-thumbnail.jpeg"
      },
      "type": "image",
      "title": "image1-rotated.jpeg",
      "caption": "<p>(12/10/2022)</p>\n<p>Natural soft slab avalanche running on surface hoar. Poma Bowl, Hurricane Ridge.</p>\n<p>Photo: NPS Olympic Rangers</p>"
    },
    {
      "id": 3,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/PXL_20221211_184955790-scaled_639bba1669bf4-large.jpg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/PXL_20221211_184955790-scaled_639bba1669bf4-medium.jpg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/PXL_20221211_184955790-scaled_639bba1669bf4.jpg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/PXL_20221211_184955790-scaled_639bba1669bf4-thumbnail.jpg"
      },
      "type": "image",
      "title": "PXL_20221211_184955790-scaled.jpg",
      "caption": "<p>(12/11/2022)</p>\n<p>Remote triggered D2 soft slab avalanche. Image shows surface hoar associated with bed surface. NW, 5200', Hurricane Ridge.</p>\n<p>Photo: Philippe Le Mouel</p>"
    },
    {
      "id": 4,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2341_639e5f2d20f3c-large.jpg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2341_639e5f2d20f3c-medium.jpg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2341_639e5f2d20f3c.jpg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2341_639e5f2d20f3c-thumbnail.jpg"
      },
      "type": "image",
      "title": null,
      "caption": "(12/17/2022) <p>Mixed snow cover exists in this shot, a WSW aspect at 4900ft. Traveling in areas with an abundance of low shrubbery will help you avoid the current avalanche problem.&nbsp;</p> Photo: Matt Lubar- Cascade Mountain Ascents"
    }
  ],
  "weather_data": null,
  "avalanche_center": {
    "id": "NWAC",
    "name": "Northwest Avalanche Center",
    "url": "https://www.nwac.us/",
    "city": "Seattle",
    "state": "WA"
  },
  "forecast_avalanche_problems": [
    {
      "id": 212927,
      "forecast_id": 115043,
      "avalanche_problem_id": 4,
      "rank": 1,
      "likelihood": "possible",
      "discussion": "<p><span style=\"font-weight: 400;\">A layer of surface hoar buried 1 to 2 feet beneath the snow&rsquo;s surface exists on sheltered slopes. It is present in areas where it was not destroyed by wind before being buried. You can read a couple observations from Saturday </span><a href=\"https://nwac.us/pro-obs/20221217_staircase-trees/\"><span style=\"font-weight: 400;\">HERE</span></a><span style=\"font-weight: 400;\"> and </span><a href=\"https://nwac.us/pro-obs/20221217_hurricane-ridge-maggies/\"><span style=\"font-weight: 400;\">HERE</span></a><span style=\"font-weight: 400;\">. In some recent pits this layer was found to be very reactive, where columns failed on isolation. In other locations results weren&rsquo;t as alarming. Natural and remotely triggered avalanches occurred on this layer about a week ago. There haven&rsquo;t been large changes in snow conditions since these events.&nbsp;</span></p>\n<p><span style=\"font-weight: 400;\">Buried </span><a href=\"https://avalanche.org/avalanche-encyclopedia/surface-hoar\"><span style=\"font-weight: 400;\">surface hoar</span></a><span style=\"font-weight: 400;\"> maintains notoriety for producing </span><a href=\"https://avalanche.org/avalanche-encyclopedia/avalanche\"><span style=\"font-weight: 400;\">avalanches</span></a><span style=\"font-weight: 400;\"> that can release on a low-angle slope, break above you, </span><a href=\"https://avalanche.org/avalanche-encyclopedia/propagation\"><span style=\"font-weight: 400;\">propagate</span></a><span style=\"font-weight: 400;\"> widely, or </span><a href=\"https://avalanche.org/avalanche-encyclopedia/trigger\"><span style=\"font-weight: 400;\">trigger</span></a><span style=\"font-weight: 400;\"> </span><a href=\"https://avalanche.org/avalanche-encyclopedia/remote-trigger\"><span style=\"font-weight: 400;\">remotely</span></a><span style=\"font-weight: 400;\">. Additional recent observations have led us to believe this problem exists in most areas where the surface hoar was not destroyed by sun or wind. This means most slopes aside from steep southerly slopes and areas where an abundance of vegetation is poking through. Assume the problem exists on smooth, open snow-covered slopes at this time.&nbsp;</span></p>\n<p><span style=\"font-weight: 400;\">Stick to ridges, thick trees, and slopes less than 30 degrees to maintain a margin of safety. Steer around steeper, unsupported, or actively </span><a href=\"https://avalanche.org/avalanche-encyclopedia/wind-loading\"><span style=\"font-weight: 400;\">wind-loading</span></a><span style=\"font-weight: 400;\"> slopes. Whumphs and rumbling </span><a href=\"https://avalanche.org/avalanche-encyclopedia/collapse\"><span style=\"font-weight: 400;\">collapses</span></a><span style=\"font-weight: 400;\"> provide a warning that the risk of </span><a href=\"https://avalanche.org/avalanche-encyclopedia/trigger\"><span style=\"font-weight: 400;\">triggering</span></a><span style=\"font-weight: 400;\"> an </span><a href=\"https://avalanche.org/avalanche-encyclopedia/avalanche\"><span style=\"font-weight: 400;\">avalanche</span></a><span style=\"font-weight: 400;\"> on a steeper slope nearby very well could happen.</span></p>",
      "media": {
        "url": {
          "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2340_639e5b64afabf-large.jpg",
          "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2340_639e5b64afabf-medium.jpg",
          "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2340_639e5b64afabf.jpg",
          "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG-2340_639e5b64afabf-thumbnail.jpg"
        },
        "type": "image",
        "title": "buried surface hoar",
        "caption": "<p>(12/17/2022)</p>\n<p>An obvious layer of buried surface hoar, seen as a thin grey line in this pit wall, is the culprit right now.&nbsp;</p>\n<p>Photo: Matt Lubar- Cascade Mountain Ascents</p>"
      },
      "location": [
        "north upper",
        "northeast upper",
        "east upper",
        "southeast upper",
        "south upper",
        "southwest upper",
        "west upper",
        "northwest upper",
        "north middle",
        "northeast middle",
        "east middle",
        "southeast middle",
        "south middle",
        "southwest middle",
        "west middle",
        "northwest middle",
        "north lower",
        "northeast lower",
        "east lower",
        "southeast lower",
        "south lower",
        "southwest lower",
        "west lower",
        "northwest lower"
      ],
      "size": [
        "2",
        "2"
      ],
      "name": "Persistent Slab",
      "problem_description": "Persistent Slab avalanches are the release of a cohesive layer of snow (a slab) in the middle to upper snowpack, when the bond to an underlying persistent weak layer breaks. Persistent layers include: surface hoar, depth hoar, near-surface facets, or faceted snow. Persistent weak layers can continue to produce avalanches for days, weeks or even months, making them especially dangerous and tricky. As additional snow and wind events build a thicker slab on top of the persistent weak layer, this avalanche problem may develop into a Deep Persistent Slab.",
      "icon": "http://api.avalanche.org/img/avalanche_problems/PersistentSlab.png"
    }
  ],
  "danger": [
    {
      "lower": 2,
      "upper": 2,
      "middle": 2,
      "valid_day": "current"
    },
    {
      "lower": null,
      "upper": null,
      "middle": null,
      "valid_day": "tomorrow"
    }
  ],
  "forecast_zone": [
    {
      "id": 1128,
      "name": "Olympics",
      "url": "http://www.nwac.us/avalanche-forecast/#/olympics",
      "state": "WA",
      "zone_id": "1"
    }
  ]
}
external vimeo link
{
  "id": "0e7654cc-a117-4484-a394-2261df38646b",
  "center_id": "btac",
  "created_at": "2023-04-01T01:38:36.337621+00:00",
  "last_updated": "2023-04-01T14:28:40.166373+00:00",
  "status": "published",
  "observer_type": "forecaster",
  "organization": "BTAC",
  "name": "Erme Catino",
  "start_date": "2023-03-31",
  "end_date": null,
  "activity": [
    "skiing_snowboarding"
  ],
  "location_point": {
    "lat": 43.528,
    "lng": -110.979
  },
  "location_name": "Glory + Taylor",
  "route": "",
  "instability": {
    "cracking": true,
    "collapsing": false,
    "avalanches_caught": false,
    "avalanches_observed": true,
    "avalanches_triggered": false,
    "cracking_description": "",
    "collapsing_description": ""
  },
  "instability_summary": "Cracking and collapsing occuring above and below new old interface - dare I say the 3/29 layer... This latest MFcr had weak snow below and produced two CTV's at the middle and upper elevations E through SE. Wind slabs were breaking on the new/old interface which was a slick crust (hardness of this crust ranged from pencil minus to one finger minus, depending on location).",
  "observation_summary": "<p>Travel today was up Glory, down Snowshoe to Coal Creek and then Taylor south trees and diving board. Noted easily triggered wind slabs in the upper elevations and wanted to gauge the 3/20 layer as this storm pushed through and we get ready for the next one. While the calender shows April 1 tomorrow, make no joke about it we have a complicated winter snowpack on our hands within the top meter of our snowpack. Height of new snow was around 25cm, comprised of graupel and rimed stellars. This newest snow lies on top of a slick melt freeze crust, which also has weak snow beneath it - a product of our last warm up. Wind slabs were failing on top of this layer, and I was able to trigger a couple test slopes that failed beneath this crust where it was thinner.</p>\n<p>The 3/20 layer is alive and producing results in pits, and just yesterday there was a human triggered slide on Taylor that failed on this layer. As the next storm arrives this weekend, it will continue to be stressed.&nbsp;</p>\n<p>Photos below:</p>\n<p>Evidence of morning wind slabs which increased in size throughout the day. D1's</p>\n<p>Old slide 7,948&rsquo; SE on the road back from Snowshoe to Coal Creek. Not sure when it failed, but the crown was decent in size and was a wind loaded feature.</p>\n<p>Snowpit results. Also uploaded a video, mind the wind near the end - it was western out there.</p>",
  "media": [
    {
      "id": 1,
      "url": {
        "external_link": "https://vimeo.com/813741951",
        "external_type": "video"
      },
      "type": "external",
      "title": "Taylor Snowpit and Analysis 20230331",
      "caption": ""
    },
    {
      "id": 2,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5585_6427870b9f605-large.jpg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5585_6427870b9f605-medium.jpg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5585_6427870b9f605.jpg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5585_6427870b9f605-thumbnail.jpg"
      },
      "type": "image",
      "title": null,
      "caption": ""
    },
    {
      "id": 3,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5653%202_64278710d5991-large.jpg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5653%202_64278710d5991-medium.jpg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5653%202_64278710d5991.jpg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5653%202_64278710d5991-thumbnail.jpg"
      },
      "type": "image",
      "title": null,
      "caption": ""
    },
    {
      "id": 4,
      "url": {
        "large": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5586%202_6427871d751c6-large.jpg",
        "medium": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5586%202_6427871d751c6-medium.jpg",
        "original": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5586%202_6427871d751c6.jpg",
        "thumbnail": "https://avalanche-org-media.s3.us-west-2.amazonaws.com/IMG_5586%202_6427871d751c6-thumbnail.jpg"
      },
      "type": "image",
      "title": null,
      "caption": ""
    }
  ],
  "urls": [],
  "avalanches_summary": "",
  "avalanches": [],
  "advanced_fields": {
    "id": "95c4d63e-2115-48a0-853a-2bd1bbceb59f",
    "observation_id": "0e7654cc-a117-4484-a394-2261df38646b",
    "observed_terrain": null,
    "time_in_field": {
      "end": 13.5,
      "start": 9.5
    },
    "weather_summary": "Mostly cloudy with snow showers, and heavier bouts of grauple and snow S1-2, which ramped up after noon. Consistent Light winds with Moderate gusts from W/WSW. Lots of blowing and drifting around of snow and graupel. Approx HN 20-25cm above 9,000'",
    "weather": {
      "air_temp": "",
      "cloud_cover": "",
      "wind_loading": "",
      "rain_elevation": "",
      "recent_snowfall": "HN past two days around 20cm",
      "snow_avail_for_transport": ""
    },
    "avalanche_comments": null,
    "snowpack_summary": "",
    "snowpack": null,
    "snowpack_media": [],
    "avalanche_problems": [
      {
        "type": "Wind Slab",
        "depth": "30cm",
        "layer": "",
        "d_size": [
          1,
          1.5
        ],
        "comments": "Cracking and collaping along leeward features with easily triggered ski cuts on steep rollovers and terrain features. Size increased from the morning lap down Snowshoe bowl - where they were 15cm and didn't pack much of a punch, to a more heads up wind slab on the next two laps on Taylor - where they were growing to 30cm in depth. These will only keep growing as the next storm comes in. Failure plane on these wind slabs was the new/old interface.",
        "location": [
          "north upper",
          "northeast upper",
          "east upper",
          "west upper",
          "northwest upper",
          "southwest upper",
          "south upper",
          "southeast upper"
        ],
        "sensitivity": "reactive",
        "distribution": "specific"
      },
      {
        "type": "Persistent Slab",
        "depth": "65cm",
        "layer": "",
        "d_size": [
          2,
          2.5
        ],
        "comments": "The 3/20 layer which has produced natural, remote, and human triggered avalanches is still producing results in snowpits. Its distribution has been most pronounced with facets on top of a crust, primarily E and SE. However, naturals and human triggered slides on north facing terrain that aligned with wind loading and near surface facets which were buried on 3/20  have also contribued to this problem. This layer will continue to be stressed as the next storm arrives tomorrow. Today 9,469' South facing on Taylor, ECTP21 down 65cm on the 3/20 layer. Additionally at 9,800' S the 3/20 layer felt even more harrowingly weak.",
        "location": [
          "west middle",
          "southeast middle",
          "east middle",
          "east upper",
          "northeast upper",
          "northwest middle",
          "north middle",
          "northeast middle",
          "north upper",
          "northwest upper",
          "west upper",
          "southeast upper",
          "south upper",
          "southwest upper",
          "southwest middle",
          "south middle"
        ],
        "sensitivity": "stubborn",
        "distribution": "specific"
      }
    ],
    "avalanche_problems_comments": "",
    "terrain_use": null,
    "bottom_line": null
  }
}

what's the difference between imageMediaSchema and photoMediaSchema?
I don't know, at all. Here's an example of a photo...

photo type
{
  "id": 77584,
  "published_time": "2019-11-26T23:18:00+00:00",
  "expires_time": "2019-12-04T06:00:00+00:00",
  "created_at": "2019-11-26T19:34:50+00:00",
  "updated_at": "2019-11-27T21:14:19+00:00",
  "author": "Ethan Davis",
  "product_type": "summary",
  "bottom_line": "<p><span style=\"font-weight: 400;\">Wind and 1-2 feet of snow will combine to quickly increase the likelihood of natural and human-triggered avalanches through Thanksgiving Day. These slides are most likely on slopes with enough pre-existing snow to cover rocks and logs. Don&rsquo;t expect the new snow to bond well to the generally weak underlying snow surface. Cracks shooting from your boards or feet are a sure sign you&rsquo;ve found a sensitive slab.</span></p>\n<p><span style=\"font-weight: 400;\"><em>We will update this post on or before Tuesday, December 3rd, 2019.</em></span></p>",
  "hazard_discussion": "<p><span style=\"font-weight: 400;\">Remember all those photos that you took in October, diligently documenting snow cover? Well now&rsquo;s the time to dig them out. Judging exactly when and where an avalanche will occur is nearly impossible but, as this storm approaches, having a mental map of current snow cover patterns will give you a big leg-up. Why? Avalanches are </span><em><span style=\"font-weight: 400;\">much</span></em><span style=\"font-weight: 400;\"> more likely to occur in areas where newly fallen snow lands on a pre-existing snowpack.</span></p>\n<p><span style=\"font-weight: 400;\">Snowstorms in late September and early October favored the Sawtooth and Western Smoky Mountains. The only direct observation we have from this area came from Ben&rsquo;s hike in the Redfish Lake Creek drainage of the Sawtooths, where he reported a foot of snow on southerly slopes above about 8,000&rsquo; and 2-3&rsquo; of snow on shadier slopes at similar elevations. On the other end of the spectrum, we have the Soldier and Wood River Valley Mountains which are mostly bare dirt. Generally, you can expect the amount and total areal extent of pre-existing snow to diminish from the Sawtooths as you head south to Galena Pass and on into the Boulders, Soldiers, and Pioneer Mountains. Check the media gallery (below) for pictures.&nbsp;</span></p>\n<p><span style=\"font-weight: 400;\">For this storm, it&rsquo;s the middle ground of the Smoky Mountains that may be the trickiest to assess. Last week, Ben and I </span><a href=\"https://www.youtube.com/watch?v=OzWuSGJRGbw&amp;t=2s\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">visited the Upper Titus weather station</span></a><span style=\"font-weight: 400;\"> near Galena Pass. The snow cover was highly variable, with dirt on sunnier slopes and up to 16&rdquo; of weak, faceted snow on shaded aspects. A crust layer near the snow surface, topped with a dusting of recent snow and feathery </span><a href=\"https://avalanche.org/avalanche-encylopedia/#surface-hoar\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">surface hoar</span></a> <span style=\"font-weight: 400;\">provided a concerning base. Galena Pass will also be the rough dividing line between higher snow totals to the south and lesser amounts to the north.</span></p>\n<p><span style=\"font-weight: 400;\">Snow stability may change quickly both as the storm progresses, and from slope-to-slope, as you change aspect and elevation. Arming yourself with a general, mental map of pre-existing snow cover is a great first step, but shouldn&rsquo;t out-weigh obvious signs of unstable snow including recent avalanches, cracking, or collapsing (</span><a href=\"https://avalanche.org/avalanche-encylopedia/#whumpf\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">whumpfs</span></a><span style=\"font-weight: 400;\">). Be on the lookout for areas with obvious signs of wind-drifted snow and expect these fresh drifts to be sensitive to your weight. </span><span style=\"font-weight: 400;\">If there&rsquo;s enough snow to make carefree turns, or you&rsquo;re trudging through stiff drifts past your knees, there may be enough snow to slide.&nbsp;</span><span style=\"font-weight: 400;\">Even small slides can have big consequences if they knock you off your feet and drag you through trees or over cliffs.</span></p>",
  "weather_discussion": "<p><a href=\"https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/Slide3.png\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">The short term weather forecast</span></a><span style=\"font-weight: 400;\"> just keeps getting better and better! That is, if you are in the Soldier and Wood River Valley Mountains (sorry Stanley and the Sawtooths). A well organized, low-pressure system is set to dip down into Northern California late Tuesday, churning Pacific moisture into the southern reaches of the forecast area. Steady snow showers will begin after dark on Tuesday and continue through the afternoon Wednesday delivering 1-2' of snow to the Soldiers, portions of the southwestern Smokys, and the mountains surrounding the Wood River and Little Wood River Valleys. The Sawtooths, shielded due to the southerly flow of this storm, will pick up 2-5\" by Thursday morning.&nbsp;</span></p>\n<p><span style=\"font-weight: 400;\">Snow showers are possible again Thanksgiving Day and Friday, but weather models diverge significantly in snow amount and location. Let&rsquo;s just say, that snow on Thursday and Friday is certainly possible, and 3-5 more inches in some areas should not be surprising. An additional storm is starting to take shape over the weekend, but we&rsquo;ll have a better handle on that as it draws nearer.&nbsp;</span></p>\n<p><span style=\"font-weight: 400;\">Don&rsquo;t forget to follow along with this season&rsquo;s storm-by-storm snow totals by checking our </span><a href=\"https://www.sawtoothavalanche.com/wp-content/uploads/records/storm_table.pdf\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Storm Totals</span></a><span style=\"font-weight: 400;\"> page daily.</span></p>",
  "announcement": null,
  "status": "published",
  "media": [
    {
      "id": 1,
      "url": "OzWuSGJRGbw",
      "type": "video",
      "caption": "(11/20/19) Ben and Ethan walked out Titus Ridge near Galena Summit to work on a weather station. While they were there, they checked in on the state of the current snowpack."
    },
    {
      "id": 2,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191116_ColdCanyonTrailCreek_03.jpg",
      "type": "photo",
      "caption": "(11/16/19) Cold Canyon near the headwaters of Trail Creek. "
    },
    {
      "id": 3,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/IMG_1030.jpg",
      "type": "photo",
      "caption": "Mid-November snow cover in the Central Sawtooths. "
    },
    {
      "id": 4,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_GalenaPk_39.jpg",
      "type": "photo",
      "caption": "(11/7/19) Bare dirt is the name of the game on the south, southwest and western exposures of the Boulder Mountains. Some snow is hanging in the northwest bowl of Galena Peak."
    },
    {
      "id": 5,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_NfacingSmokys_01.jpg",
      "type": "photo",
      "caption": "(11/7/19) This image shows a good amount of snow lingering in north-facing, alpine terrain of the Smoky Mountains."
    },
    {
      "id": 6,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/191107_SnowysidePk_41.jpg",
      "type": "photo",
      "caption": "(11/7/19) East and northeast aspects of the Sawtooth Mountains including Cabin Peak and Snowyside Peak."
    },
    {
      "id": 7,
      "url": "https://www.sawtoothavalanche.com/wp-content/uploads/2019/11/Slide3.png",
      "type": "photo",
      "caption": "Here is the official snowfall forecast issued by the National Weather Service in Pocatello. "
    }
  ],
  "weather_data": null,
  "avalanche_center": {
    "id": "SNFAC",
    "name": "Sawtooth Avalanche Center",
    "url": "https://www.sawtoothavalanche.com/",
    "city": "Ketchum",
    "state": "ID"
  },
  "forecast_avalanche_problems": [],
  "danger": [],
  "forecast_zone": [
    {
      "id": 714,
      "name": "Galena Summit & Eastern Mtns",
      "url": "https://www.sawtoothavalanche.com/forecasts/#/galena-summit-&-eastern-mtns",
      "state": "ID",
      "zone_id": "3"
    },
    {
      "id": 715,
      "name": "Soldier & Wood River Valley Mtns",
      "url": "https://www.sawtoothavalanche.com/forecasts/#/soldier-&-wood-river-valley-mtns",
      "state": "ID",
      "zone_id": "4"
    },
    {
      "id": 716,
      "name": "Sawtooth & Western Smoky Mtns",
      "url": "https://www.sawtoothavalanche.com/forecasts/#/sawtooth-&-western-smoky-mtns",
      "state": "ID",
      "zone_id": "2"
    },
    {
      "id": 717,
      "name": "Banner Summit",
      "url": "https://www.sawtoothavalanche.com/forecasts/#/banner-summit",
      "state": "ID",
      "zone_id": "1"
    }
  ]
}

I'm wondering if we should do the work to support all types
Over time, yes, I think so!

@yuliadub
Copy link
Collaborator

I think we could have a link to a video/reel on instagram too, just FYI

@kevinherdez not sure if you already found this, but from a quick look, expo has a video player but not sure if this would work for us: https://expo.dev/blog/expo-video-a-simple-powerful-way-to-play-videos-in-apps. Seems like there is a few gotchas in there.

one possible alternative would be to show a preview that is clickable and then pop open a safari browser to view the video inside app (if we find that is really hard/time consuming/buggy to create a custom video viewer for whatever reason) but that likely wouldnt be the best user experience...?

@kevinherdez
Copy link

Sorry for the late reply here. I think something is messed up with my Github notifications because I didn't get an email about the replies. I'm going to dive back in to try to remember why I didn't end up trying to use expo-video because it seems like a good. I think either of those options could be good, and I agree that the custom carousel would probably be the best but I think maybe we could at least get started with maybe making a preview clickable and showing a second modal. It's not ideal, but I did have the videos playing in the app. They just weren't in a nice carousel

@kevinherdez
Copy link

I remember now why I was trying to do this completely custom. Back in the fall expo-video was still in beta so I avoided it. They've since released a stable version along with Expo 52. I still have my demo branch so I'm going to get that working on current main, and add expo-video because that could make a custom carousel a lot easier or, at the very least, we could do an easy work around while we build out something nicer.

@stevekuznetsov
Copy link
Collaborator

@kevinherdez awesome! That sounds great.

@kevinherdez
Copy link

Just a quick update. Unfortunately, expo-video doesn't support showing videos through youtube links. However, I was able to fix up my code and I have an extremely barebones solution that shows a viewer with a mix of both images and videos (I need to fix how the images are displayed). There's still a lot of work left like getting the image viewer to behave like it did in the old package, showing the headers and footers, and fixing the video viewing experience, but hopefully it won't be as crazy involved as I thought it was back in the fall.

What's the timeline that we're aiming for for this? I'm trying to set aside 5-10 hours a week to try to work on this, and I just want to make sure I'm going to get it done in a timely manner.

Custom Video Image Viewer Demo
Image

@stevekuznetsov
Copy link
Collaborator

@kevinherdez we'd love to be able to deliver this before the end of the forecast season, so please don't stress on timing! Getting folks to benefit from this feature before the snow stops falling is a huge win. If you'd like to minimize the diffs we can put the new impl behind a feature flag and roll it to subsets of users for feedback before it's fully baked.

@rustynwac
Copy link

@kevinherdez Thanks for the work! I'll echo what Steve said on the timing. Do you have a (rough) sense of how many hours are needed in total?

@kevinherdez
Copy link

I think it depends on if I can find some packages that will handle the image viewing but I would guess maybe 15-20 hours of work to get it in a good internal testing state and them hopefully not much more after to get it production ready. However, due to unforeseen circumstances completely within my control, I broke my collarbone while riding and need to get surgery so I may not be able circle back on this for a week or so

@kevinherdez
Copy link

Just wanted to give an update. I'm trying to go with a custom carousel based on the one we had. I have it looking pretty similar, it's just lacking some features like the pinch/double tap to zoom, but it's showing both videos and images nicely. There's some weird quirks that I need to fix when showing a video and some UI polish. It's getting close to a point where I would feel good about trying to get it in behind a feature flag so that the initial PR isn't massive and then I can make smaller PRs to address any fixes we find through testing. I'm hoping this week I can spend a lot of time on it.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants